【代码评审】AI:AI 绘图的接入

This commit is contained in:
YunaiV 2024-06-17 20:06:56 +08:00
parent 7c1e949d77
commit a331ed546d
4 changed files with 4 additions and 3 deletions

View File

@ -85,7 +85,7 @@ public class AiImageController {
public CommonResult<Boolean> midjourneyAction(@RequestParam("id") Long imageId, public CommonResult<Boolean> midjourneyAction(@RequestParam("id") Long imageId,
@RequestParam("customId") String customId) { @RequestParam("customId") String customId) {
imageService.midjourneyAction(getLoginUserId(), imageId, customId); imageService.midjourneyAction(getLoginUserId(), imageId, customId);
return success(null); return success(true);
} }
} }

View File

@ -102,6 +102,7 @@ public class AiImageDO extends BaseDO {
@TableField(typeHandler = JacksonTypeHandler.class) @TableField(typeHandler = JacksonTypeHandler.class)
private MidjourneyNotifyReqVO response; private MidjourneyNotifyReqVO response;
// TODO @fan这个建议 Double
/** /**
* mj 进度(10%50%100%) * mj 进度(10%50%100%)
*/ */

View File

@ -29,7 +29,7 @@ import java.util.Map;
public class MidjourneyJob implements JobHandler { public class MidjourneyJob implements JobHandler {
// TODO @fan@Resource // TODO @fan@Resource
@Autowired @Autowired(required = false)
private MidjourneyApi midjourneyApi; private MidjourneyApi midjourneyApi;
@Autowired @Autowired
private AiImageMapper imageMapper; private AiImageMapper imageMapper;

View File

@ -55,7 +55,7 @@ public class AiImageServiceImpl implements AiImageService {
private FileApi fileApi; private FileApi fileApi;
@Resource @Resource
private AiApiKeyService apiKeyService; private AiApiKeyService apiKeyService;
@Autowired @Autowired(required = false)
private MidjourneyApi midjourneyApi; private MidjourneyApi midjourneyApi;
@Value("${ai.midjourney-proxy.notifyUrl:http://127.0.0.1:48080/admin-api/ai/image/midjourney-notify}") @Value("${ai.midjourney-proxy.notifyUrl:http://127.0.0.1:48080/admin-api/ai/image/midjourney-notify}")
private String midjourneyNotifyUrl; private String midjourneyNotifyUrl;