feat: 活动删除功能完成
This commit is contained in:
parent
97b6f2ddb3
commit
9774070d93
@ -42,5 +42,31 @@ public class ActivateController {
|
|||||||
public ResponseEntity updateActivate(@RequestBody ActiveBaseInfo activeBaseInfo){
|
public ResponseEntity updateActivate(@RequestBody ActiveBaseInfo activeBaseInfo){
|
||||||
return ResponseEntity.ok(activateService.updateActivate(activeBaseInfo));
|
return ResponseEntity.ok(activateService.updateActivate(activeBaseInfo));
|
||||||
}
|
}
|
||||||
|
@Operation(
|
||||||
|
summary = "活动 删除(逻辑)",
|
||||||
|
description = "删除活动",
|
||||||
|
tags = {"活动相关接口"}
|
||||||
|
)
|
||||||
|
@PostMapping("/del/status")
|
||||||
|
public ResponseEntity delActivateStatus(@RequestBody ActiveBaseInfo activeBaseInfo){
|
||||||
|
return ResponseEntity.ok(activateService.delActivateStatus(activeBaseInfo));
|
||||||
|
}
|
||||||
|
@Operation(
|
||||||
|
summary = "活动 删除(物理)",
|
||||||
|
description = "删除活动",
|
||||||
|
tags = {"活动相关接口"}
|
||||||
|
)
|
||||||
|
@PostMapping("/del/real")
|
||||||
|
public ResponseEntity delActivateReal(@RequestBody ActiveBaseInfo activeBaseInfo){
|
||||||
|
return ResponseEntity.ok(activateService.delActivateReal(activeBaseInfo));
|
||||||
|
}
|
||||||
|
@Operation(
|
||||||
|
summary = "活动 删除恢复",
|
||||||
|
description = "恢复逻辑删除的数据",
|
||||||
|
tags = {"活动相关接口"}
|
||||||
|
)
|
||||||
|
@PostMapping("/del/not")
|
||||||
|
public ResponseEntity delActivateNot(@RequestBody ActiveBaseInfo activeBaseInfo){
|
||||||
|
return ResponseEntity.ok(activateService.delActivateNot(activeBaseInfo));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,4 +14,10 @@ public interface ActivateService {
|
|||||||
ResponseResult loadActivate();
|
ResponseResult loadActivate();
|
||||||
|
|
||||||
ResponseResult updateActivate(ActiveBaseInfo activeBaseInfo);
|
ResponseResult updateActivate(ActiveBaseInfo activeBaseInfo);
|
||||||
|
|
||||||
|
ResponseResult delActivateStatus(ActiveBaseInfo activeBaseInfo);
|
||||||
|
|
||||||
|
ResponseResult delActivateReal(ActiveBaseInfo activeBaseInfo);
|
||||||
|
|
||||||
|
ResponseResult delActivateNot(ActiveBaseInfo activeBaseInfo);
|
||||||
}
|
}
|
||||||
|
@ -80,4 +80,36 @@ public class ActivateServiceImpl implements ActivateService {
|
|||||||
return ResponseResult.error("更新失败");
|
return ResponseResult.error("更新失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult delActivateStatus(ActiveBaseInfo activeBaseInfo) {
|
||||||
|
activeBaseInfo.setStatus(-1);
|
||||||
|
int i = activateMapper.updateById(activeBaseInfo);
|
||||||
|
if(i>0){
|
||||||
|
return ResponseResult.success(activeBaseInfo);
|
||||||
|
}else{
|
||||||
|
return ResponseResult.error("删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult delActivateReal(ActiveBaseInfo activeBaseInfo) {
|
||||||
|
int i = activateMapper.deleteById(activeBaseInfo.getId());
|
||||||
|
if(i>0){
|
||||||
|
return ResponseResult.success();
|
||||||
|
}else{
|
||||||
|
return ResponseResult.error("删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ResponseResult delActivateNot(ActiveBaseInfo activeBaseInfo) {
|
||||||
|
activeBaseInfo.setStatus(0);
|
||||||
|
int i = activateMapper.updateById(activeBaseInfo);
|
||||||
|
if(i>0){
|
||||||
|
return ResponseResult.success(activeBaseInfo);
|
||||||
|
}else{
|
||||||
|
return ResponseResult.error("恢复删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user