feat(controller): 添加硬删除功能并替换现有删除方法
- 在 BatchImportSupport 中新增 hardRemoveById 和 hardRemoveByIds 方法实现物理删除 - 替换所有控制器中的删除方法调用为新的硬删除方法 - 硬删除方法支持通过实体类和ID进行单个或批量物理删除 - 实现了分块处理大量ID的批量删除功能,避免数据库限制 - 保持 MyBatis-Plus 拦截器兼容性以
This commit is contained in:
@@ -104,7 +104,7 @@ public class CreditCompetitorController extends BaseController {
|
||||
@Operation(summary = "删除竞争对手")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (creditCompetitorService.removeById(id)) {
|
||||
if (batchImportSupport.hardRemoveById(CreditCompetitor.class, id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
@@ -137,7 +137,7 @@ public class CreditCompetitorController extends BaseController {
|
||||
@Operation(summary = "批量删除竞争对手")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (creditCompetitorService.removeByIds(ids)) {
|
||||
if (batchImportSupport.hardRemoveByIds(CreditCompetitor.class, ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
|
||||
Reference in New Issue
Block a user