Commit fc110a0f by Jony.L

图片转换 view接口

parent 9d4041d7
......@@ -101,6 +101,13 @@ public class OpenApiController {
return openApiService.viewImage(viewImageReqDTO);
}
@ApiAccessLog
@GetMapping("/view-convert")
@Operation(summary = "根据promptId取转换后的图", description = "根据promptId取图片转换后的图")
public CommonResult<ViewSourceRespDTO> viewConvert(@RequestParam String promptId){
return openApiService.viewConvert(promptId);
}
@ApiAccessLog
@PostMapping(value = "/generate-face-swap-video", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
......
......@@ -51,6 +51,8 @@ public interface OpenApiService {
CommonResult<ViewSourceRespDTO> viewImage(ViewImageReqDTO viewImageReqDTO);
CommonResult<ViewSourceRespDTO> viewConvert(String promptId);
CommonResult<List<MatchImageRespDTO>> matchImage(MultipartFile image, String url, Integer limit, String cityId, String touristAreaId);
CommonResult<AIQARespDTO> AIQAChat(AIQAReqDTO aiqaReqDTO);
......
......@@ -117,6 +117,9 @@ public class OpenApiServiceImpl implements OpenApiService {
@Value("${aigc-apps.view-image}")
private String viewImageUrl;
@Value("${aigc-apps.view-convert}")
private String viewConvertUrl;
@Value("${aigc-apps.AIQA-chat}")
private String AIQAchat;
......@@ -401,6 +404,20 @@ public class OpenApiServiceImpl implements OpenApiService {
}
}
@Override
public CommonResult<ViewSourceRespDTO> viewConvert(String promptId) {
try {
Map<String, String> queryParams = new HashMap<>();
queryParams.put("promptId", promptId);
String result = HttpUtils.get(viewConvertUrl, null, queryParams);
return handleJsonObjectResult(result, ViewSourceRespDTO.class);
} catch (Exception e) {
Integer errorCode = GlobalResponseCodeConstants.INTERNAL_SERVER_ERROR.getCode();
String errorMsg = GlobalResponseCodeConstants.INTERNAL_SERVER_ERROR.getMsg();
return error(errorCode, errorMsg);
}
}
@Override
public CommonResult<List<MatchImageRespDTO>> matchImage(MultipartFile image, String url, Integer limit, String cityId, String touristAreaId) {
......
......@@ -398,13 +398,15 @@ aigc-apps:
upload-image: ${aigc-apps.base-url}/open-api/face-swap/videos
create-video-stream: ${aigc-apps.base-url}/open-api/face-swap/videos
view-video: ${aigc-apps.base-url}/open-api/view/video
image-to-video: ${aigc-apps.base-url}/open-api/face-swap/videos
image-to-image: ${aigc-apps.base-url}/open-api/face-swap/images
image-convert: ${aigc-apps.base-url}/open-api/image-convert
view-image: ${aigc-apps.base-url}/open-api/view/image
view-convert: ${aigc-apps.base-url}/open-api/view/convert
download-video: ${aigc-apps.base-url}/open-api/download/video
download-image: ${aigc-apps.base-url}/open-api/download/image
download-mocha: ${aigc-apps.base-url}/open-api/download/mocha
download-convert: ${aigc-apps.base-url}/open-api/download/
image-to-video: ${aigc-apps.base-url}/open-api/face-swap/videos
image-to-image: ${aigc-apps.base-url}/open-api/face-swap/images
image-convert: ${aigc-apps.base-url}/open-api/image-convert
check-prompt-id: ${aigc-apps.base-url}/open-api/download/check
AIQA-chat: ${aigc-apps.base-url}/v1/AIQA-chat
AIQA-stream-chat: ${aigc-apps.base-url}/v1/AIQA-stream-chat
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment