Commit a331ed546dcf90a0b9d966bc694e40c5780ba708
1 parent
7c1e949d
【代码评审】AI:AI 绘图的接入
Showing
4 changed files
with
4 additions
and
3 deletions
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/controller/admin/image/AiImageController.java
| @@ -85,7 +85,7 @@ public class AiImageController { | @@ -85,7 +85,7 @@ public class AiImageController { | ||
| 85 | public CommonResult<Boolean> midjourneyAction(@RequestParam("id") Long imageId, | 85 | public CommonResult<Boolean> midjourneyAction(@RequestParam("id") Long imageId, |
| 86 | @RequestParam("customId") String customId) { | 86 | @RequestParam("customId") String customId) { |
| 87 | imageService.midjourneyAction(getLoginUserId(), imageId, customId); | 87 | imageService.midjourneyAction(getLoginUserId(), imageId, customId); |
| 88 | - return success(null); | 88 | + return success(true); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | } | 91 | } |
| 92 | \ No newline at end of file | 92 | \ No newline at end of file |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/dal/dataobject/image/AiImageDO.java
| @@ -102,6 +102,7 @@ public class AiImageDO extends BaseDO { | @@ -102,6 +102,7 @@ public class AiImageDO extends BaseDO { | ||
| 102 | @TableField(typeHandler = JacksonTypeHandler.class) | 102 | @TableField(typeHandler = JacksonTypeHandler.class) |
| 103 | private MidjourneyNotifyReqVO response; | 103 | private MidjourneyNotifyReqVO response; |
| 104 | 104 | ||
| 105 | + // TODO @fan:这个建议 Double | ||
| 105 | /** | 106 | /** |
| 106 | * mj 进度(10%、50%、100%) | 107 | * mj 进度(10%、50%、100%) |
| 107 | */ | 108 | */ |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/job/MidjourneyJob.java
| @@ -29,7 +29,7 @@ import java.util.Map; | @@ -29,7 +29,7 @@ import java.util.Map; | ||
| 29 | public class MidjourneyJob implements JobHandler { | 29 | public class MidjourneyJob implements JobHandler { |
| 30 | 30 | ||
| 31 | // TODO @fan:@Resource | 31 | // TODO @fan:@Resource |
| 32 | - @Autowired | 32 | + @Autowired(required = false) |
| 33 | private MidjourneyApi midjourneyApi; | 33 | private MidjourneyApi midjourneyApi; |
| 34 | @Autowired | 34 | @Autowired |
| 35 | private AiImageMapper imageMapper; | 35 | private AiImageMapper imageMapper; |
yudao-module-ai/yudao-module-ai-biz/src/main/java/cn/iocoder/yudao/module/ai/service/image/AiImageServiceImpl.java
| @@ -55,7 +55,7 @@ public class AiImageServiceImpl implements AiImageService { | @@ -55,7 +55,7 @@ public class AiImageServiceImpl implements AiImageService { | ||
| 55 | private FileApi fileApi; | 55 | private FileApi fileApi; |
| 56 | @Resource | 56 | @Resource |
| 57 | private AiApiKeyService apiKeyService; | 57 | private AiApiKeyService apiKeyService; |
| 58 | - @Autowired | 58 | + @Autowired(required = false) |
| 59 | private MidjourneyApi midjourneyApi; | 59 | private MidjourneyApi midjourneyApi; |
| 60 | @Value("${ai.midjourney-proxy.notifyUrl:http://127.0.0.1:48080/admin-api/ai/image/midjourney-notify}") | 60 | @Value("${ai.midjourney-proxy.notifyUrl:http://127.0.0.1:48080/admin-api/ai/image/midjourney-notify}") |
| 61 | private String midjourneyNotifyUrl; | 61 | private String midjourneyNotifyUrl; |