【增加】ai image对接通义

This commit is contained in:
cherishsince
2024-07-10 21:34:42 +08:00
parent 28018b1f7f
commit d6b3b5e9bd
4 changed files with 6 additions and 4 deletions

View File

@ -137,9 +137,9 @@ 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())) {
} else if (ObjUtil.equal(draw.getPlatform(), AiPlatformEnum.TONG_YI.getPlatform())) {
return TongYiImagesOptions.builder()
.withModel(draw.getModel()).withN(Integer.valueOf(draw.getOptions().get("n")))
.withModel(draw.getModel()).withN(1)
.withHeight(draw.getHeight()).withWidth(draw.getWidth())
.build();
}

View File

@ -106,7 +106,7 @@ public class AiApiKeyServiceImpl implements AiApiKeyService {
@Override
public ImageModel getImageModel(AiPlatformEnum platform) {
AiApiKeyDO apiKey = apiKeyMapper.selectFirstByPlatformAndStatus(platform.getName(), CommonStatusEnum.ENABLE.getStatus());
AiApiKeyDO apiKey = apiKeyMapper.selectFirstByPlatformAndStatus(platform.getPlatform(), CommonStatusEnum.ENABLE.getStatus());
if (apiKey == null) {
throw exception(API_KEY_IMAGE_NODE_FOUND, platform.getName());
}