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 d072822eb..e64edec2c 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 @@ -36,6 +36,12 @@ public class AiImageController { return CommonResult.success(aiImageService.list(req)); } + @Operation(summary = "获取image信息", description = "获取image信息") + @GetMapping("/get") + public CommonResult get(@RequestParam("id") Long id) { + return CommonResult.success(aiImageService.get(id)); + } + @Operation(summary = "dall2/dall3绘画", description = "openAi dall3是付费的!") @PostMapping("/dall") public AiImageDallRespVO dallDrawing(@Validated @RequestBody AiImageDallReqVO req) { diff --git a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/convert/AiImageConvert.java b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/convert/AiImageConvert.java index df8647a5b..c09614739 100644 --- a/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/convert/AiImageConvert.java +++ b/yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/convert/AiImageConvert.java @@ -47,6 +47,14 @@ public interface AiImageConvert { */ List convertAiImageListRespVO(List list); + /** + * 转换 - AiImageListRespVO + * + * @param aiImageDO + * @return + */ + AiImageListRespVO convertAiImageListRespVO(AiImageDO aiImageDO); + /** * 转换 - AiImageMidjourneyOperationsVO * 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 4af34d3bf..1d4e24764 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 @@ -20,6 +20,14 @@ public interface AiImageService { */ PageResult list(AiImageListReqVO req); + /** + * 获取 - image 信息 + * + * @param id + * @return + */ + AiImageListRespVO get(Long id); + /** * ai绘画 - dall2/dall3 绘画 * 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 5d01483ec..f635fb70e 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 @@ -92,6 +92,12 @@ public class AiImageServiceImpl implements AiImageService { return result; } + @Override + public AiImageListRespVO get(Long id) { + AiImageDO aiImageDO = aiImageMapper.selectById(id); + return AiImageConvert.INSTANCE.convertAiImageListRespVO(aiImageDO); + } + @Override public AiImageDallRespVO dallDrawing(AiImageDallReqVO req) { // 保存数据库