diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/AiImageController.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/AiImageController.java index e847cc193e..8b279e484f 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/AiImageController.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/AiImageController.java @@ -78,13 +78,11 @@ public class AiImageController { } // TODO @fan:类似 /my-page 的建议 - // TODO @fan:目前如果没结果,返回 Boolean 哈 @Operation(summary = "删除【我的】绘画记录") @DeleteMapping("/delete-my") @Parameter(name = "id", required = true, description = "绘画编号", example = "1024") - public CommonResult deleteMy(@RequestParam("id") Long id) { - aiImageService.deleteMy(id, getLoginUserId()); - return success(null); + public CommonResult deleteMy(@RequestParam("id") Long id) { + return success(aiImageService.deleteMy(id, getLoginUserId())); } } diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java index 7cb44fa5b9..6a374178ae 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageService.java @@ -62,6 +62,6 @@ public interface AiImageService { * @param id * @param loginUserId */ - void deleteMy(Long id, Long loginUserId); + Boolean deleteMy(Long id, Long loginUserId); } diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java index a3494fb20f..fc23ed6fba 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java @@ -184,7 +184,7 @@ public class AiImageServiceImpl implements AiImageService { } @Override - public void deleteMy(Long id, Long userId) { + public Boolean deleteMy(Long id, Long userId) { // 校验是否存在,并获取 image AiImageDO image = validateExists(id); // 是否属于当前用户 @@ -192,7 +192,7 @@ public class AiImageServiceImpl implements AiImageService { throw exception(ErrorCodeConstants.AI_IMAGE_NOT_EXISTS); } // 删除记录 - imageMapper.deleteById(id); + return imageMapper.deleteById(id) > 0; } private void validateMessageId(String mjMessageId, String messageId) {