From 2c61acf913017d22cb26c8225fa89c9ecebca753 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 29 Jun 2024 07:57:01 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91AI=EF=BC=9A=E5=9B=BE=E7=89=87=E8=BD=AE=E8=AF=A2?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/controller/admin/image/AiImageController.java | 2 +- .../yudao/module/ai/service/image/AiImageService.java | 9 ++++----- .../module/ai/service/image/AiImageServiceImpl.java | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) 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 e30c4e3e6..00adb813c 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 @@ -61,7 +61,7 @@ public class AiImageController { @Operation(summary = "获取【我的】绘图记录列表") @Parameter(name = "ids", required = true, description = "绘画编号数组", example = "1024,2048") public CommonResult> getImageListMyByIds(@RequestParam("ids") List ids) { - List imageList = imageService.getImageByIds(ids); + List imageList = imageService.getImageList(ids); imageList.removeIf(item -> !ObjUtil.equal(getLoginUserId(), item.getUserId())); return success(BeanUtils.toBean(imageList, AiImageRespVO.class)); } 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 f65bb3ee3..fc348617a 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 @@ -5,7 +5,6 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageDrawReqVO; import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImagePageReqVO; -import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageRespVO; import cn.iocoder.yudao.module.ai.controller.admin.image.vo.AiImageUpdatePublicStatusReqVO; import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyActionReqVO; import cn.iocoder.yudao.module.ai.controller.admin.image.vo.midjourney.AiMidjourneyImagineReqVO; @@ -39,12 +38,12 @@ public interface AiImageService { AiImageDO getImage(Long id); /** - * 获得绘图记录 - 多个 + * 获得绘图列表 * - * @param ids - * @return + * @param ids 绘图编号数组 + * @return 绘图记录列表 */ - List getImageByIds(List ids); + List getImageList(List ids); /** * 绘制图片 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 c65eb19f1..862bdf0b2 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 @@ -76,7 +76,7 @@ public class AiImageServiceImpl implements AiImageService { } @Override - public List getImageByIds(List ids) { + public List getImageList(List ids) { if (CollUtil.isEmpty(ids)) { return Collections.emptyList(); } @@ -128,7 +128,7 @@ public class AiImageServiceImpl implements AiImageService { } else if (ObjUtil.equal(draw.getPlatform(), AiPlatformEnum.STABLE_DIFFUSION.getPlatform())) { // https://platform.stability.ai/docs/api-reference#tag/Text-to-Image/operation/textToImage return StabilityAiImageOptions.builder().withModel(draw.getModel()) - .withHeight(draw.getHeight()).withWidth(draw.getWidth()) // TODO @芋艿:各种参数 + .withHeight(draw.getHeight()).withWidth(draw.getWidth()) // TODO @范:各种参数的接入 .build(); } throw new IllegalArgumentException("不支持的 AI 平台:" + draw.getPlatform());