From 9878abb03c7ebee3e234ee0a1f12491d9a6cb348 Mon Sep 17 00:00:00 2001 From: cherishsince Date: Tue, 28 May 2024 14:05:44 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=8D=95=E4=B8=AA=20image=20=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/controller/admin/image/AiImageController.java | 6 ++++++ .../iocoder/yudao/module/ai/convert/AiImageConvert.java | 8 ++++++++ .../yudao/module/ai/service/image/AiImageService.java | 8 ++++++++ .../yudao/module/ai/service/image/AiImageServiceImpl.java | 6 ++++++ 4 files changed, 28 insertions(+) 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 d072822eb9..e64edec2cc 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 df8647a5b9..c096147397 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 4af34d3bfa..1d4e24764a 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 5d01483ecc..f635fb70ec 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) { // 保存数据库