diff --git a/script/idea/http-client.env.json b/script/idea/http-client.env.json index 4a4cb5221..17dd0d50d 100644 --- a/script/idea/http-client.env.json +++ b/script/idea/http-client.env.json @@ -1,7 +1,7 @@ { "local": { "baseUrl": "http://127.0.0.1:48080/admin-api", - "token": "test1", + "token": "Bearer 1c2ce60de96a4fb0bf5bea9604099a3d", "adminTenentId": "1", "appApi": "http://127.0.0.1:48080/app-api", 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 27c0978f1..0d9d467e6 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 @@ -23,6 +23,7 @@ import cn.iocoder.yudao.module.ai.dal.mysql.image.AiImageMapper; import cn.iocoder.yudao.module.ai.enums.image.AiImageStatusEnum; import cn.iocoder.yudao.module.ai.service.model.AiApiKeyService; import cn.iocoder.yudao.module.infra.api.file.FileApi; +import com.alibaba.cloud.ai.tongyi.image.TongYiImagesOptions; import jakarta.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.ai.image.ImageModel; @@ -136,6 +137,11 @@ public class AiImageServiceImpl implements AiImageService { .withStylePreset(String.valueOf(draw.getOptions().get("stylePreset"))) .withClipGuidancePreset(String.valueOf(draw.getOptions().get("clipGuidancePreset"))) .build(); + } else if (ObjUtil.equal(draw.getPlatform(), AiPlatformEnum.TONG_YI_WAN_XIANG.getPlatform())) { + return TongYiImagesOptions.builder() + .withModel(draw.getModel()).withN(Integer.valueOf(draw.getOptions().get("n"))) + .withHeight(draw.getHeight()).withWidth(draw.getWidth()) + .build(); } throw new IllegalArgumentException("不支持的 AI 平台:" + draw.getPlatform()); } diff --git a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java index fc1e9f429..dea5ea4db 100644 --- a/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java +++ b/yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/enums/AiPlatformEnum.java @@ -28,6 +28,8 @@ public enum AiPlatformEnum { STABLE_DIFFUSION("StableDiffusion", "StableDiffusion"), // Stability AI MIDJOURNEY("Midjourney", "Midjourney"), // Midjourney SUNO("Suno", "Suno"), // Suno AI + TONG_YI_WAN_XIANG("TongYiWanXiang", "通义万相"), // Suno AI + ; /**