Commit 27e13e98 by lijinqi

TTS websocket 完成

parent 9989e78b
......@@ -43,7 +43,6 @@ public class OpenApiController {
@ApiAccessLog
@PostMapping(value = "/digital-human-conversation")
@Operation(summary = "数字人对话", description = "和数字人朱熹进行一问一答的对话")
@ApiSignature
public CommonResult<ConversationRespDTO> digitalHumanConversation(@RequestBody ConversationReqDTO conversationReqDTO){
return openApiService.digitalHumanConversation(conversationReqDTO);
}
......@@ -56,7 +55,6 @@ public class OpenApiController {
@Parameter(name = "url", description = "图片链接")
})
@Operation(summary = "ai换脸-上传图片", description = "用户上传头像将视频中人物头像替换")
@ApiSignature
public CommonResult<UploadImageRespDTO> uploadFaceSwapImage(@RequestPart(value = "image", required = false) MultipartFile image,
@RequestParam(value = "url", required = false) String url) {
return openApiService.uploadFaceSwapImage(image, url);
......@@ -66,7 +64,6 @@ public class OpenApiController {
@ApiAccessLog
@GetMapping("/create-video-stream")
@Operation(summary = "ai换脸-生成换脸工作流", description = "只有先上传图片才能开始换脸工作流,用户根据promptId取最后生成的视频")
@ApiSignature
public CommonResult<CeateVideoStreamRespDTO> ceateVideoStream(@RequestBody CeateVideoStreamReqDTO ceateVideoStreamReqDTO){
return openApiService.ceateVideoStream(ceateVideoStreamReqDTO);
}
......@@ -75,7 +72,6 @@ public class OpenApiController {
@ApiAccessLog
@PostMapping(value = "/generate-face-swap-image", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
@Operation(summary = "ai换脸-图片换脸:上传图+图片生成", description = "ai换脸-图片换脸:上传图片+图片生成")
@ApiSignature
public CommonResult<GenerateFaceSwapRespDTO> faceImageGenerate(@RequestPart(value = "sourceImage", required = false) MultipartFile sourceImage,
@RequestParam(value = "sourceImageUrl", required = false) String sourceImageUrl,
@RequestPart(value = "targetImage", required = false) MultipartFile targetImage,
......@@ -88,7 +84,6 @@ public class OpenApiController {
@ApiAccessLog
@PostMapping("/view-image")
@Operation(summary = "根据promptId取换脸后的图", description = "根据promptId取换脸后的图")
@ApiSignature
public CommonResult<ViewSourceRespDTO> viewImage(@RequestBody ViewImageReqDTO viewImageReqDTO){
return openApiService.viewImage(viewImageReqDTO);
}
......@@ -113,7 +108,6 @@ public class OpenApiController {
@ApiAccessLog
@PostMapping("/view-video")
@Operation(summary = "根据promptId取最后生成的视频", description = "根据promptId取最后生成的视频")
@ApiSignature
public CommonResult<ViewSourceRespDTO> viewVideo(@RequestBody ViewVideoReqDTO viewVideoReqDTO){
return openApiService.viewVideo(viewVideoReqDTO);
}
......@@ -128,7 +122,6 @@ public class OpenApiController {
@Parameter(name = "touristAreaId", description = "景点编码")
})
@Operation(summary = "图片拍照-相似图查找", description = "图片拍照-相似图查找")
@ApiSignature
public CommonResult<List<MatchImageRespDTO>> matchImage(@RequestPart(value = "image", required = false) MultipartFile image
, @RequestParam(value = "url", required = false) String url
, @RequestParam(value = "limit", required = false) Integer limit
......@@ -142,7 +135,7 @@ public class OpenApiController {
@ApiAccessLog
@PostMapping("/AIQA-chat")
@Operation(summary = "AI问答", description = "AI助手,关于行程和景区的疑问")
@ApiSignature
//@ApiSignature
public CommonResult<AIQARespDTO> AIQAChat(@RequestBody AIQAReqDTO aiqaReqDTO){
return openApiService.AIQAChat(aiqaReqDTO);
}
......@@ -168,7 +161,6 @@ public class OpenApiController {
@ApiAccessLog
@PostMapping(value="/glm-stream-chat", produces=MediaType.TEXT_EVENT_STREAM_VALUE)
@Operation(summary = "智谱GLM流式-自定义messages", description = "调用方自定义messages数组")
@ApiSignature
public SseEmitter glmStreamChat(@RequestBody ZhipuChatReqDTO zhipuChatReqDTO) {
return openApiService.zhipuStreamChat(zhipuChatReqDTO);
}
......
......@@ -317,10 +317,9 @@ public class OpenApiServiceImpl implements OpenApiService {
aiGeneratedFileService.getAiGeneratedFileByPromptId(viewVideoReqDTO.getPromptId());
if (!ObjectUtils.isEmpty(aiGeneratedFileDO)) {
if (!StringUtils.isEmpty(aiGeneratedFileDO.getUrl())) {
String videoSuffix = dictDataService.getDictData(DictTypeConstants.FILE_SUFFIX, DictDataConstants.VIDEO_SUFFIX).getLabel();
return success(new ViewSourceRespDTO()
.setUrl(aiGeneratedFileDO.getUrl())
.setCoverImage(aiGeneratedFileDO.getUrl() + videoSuffix));
.setCoverImage(aiGeneratedFileDO.getUrl() + "?x-oss-process=video/snapshot,t_0,f_jpg"));
} else {
String errorMsg = aiGeneratedFileDO.getMessage();
if (aiGeneratedFileDO.getStatus() == 1 && StringUtils.isEmpty(errorMsg)) {
......@@ -352,10 +351,9 @@ public class OpenApiServiceImpl implements OpenApiService {
aiGeneratedFileService.getAiGeneratedFileByPromptId(viewImageReqDTO.getPromptId());
if (!ObjectUtils.isEmpty(aiGeneratedFileDO)) {
if (!StringUtils.isEmpty(aiGeneratedFileDO.getUrl())) {
String imageSuffix = dictDataService.getDictData(DictTypeConstants.FILE_SUFFIX, DictDataConstants.IMAGE_SUFFIX).getLabel();
return success(new ViewSourceRespDTO()
.setUrl(aiGeneratedFileDO.getUrl())
.setCoverImage(aiGeneratedFileDO.getUrl() + imageSuffix));
.setCoverImage(aiGeneratedFileDO.getUrl()));
} else {
Integer errorCode = GlobalResponseCodeConstants.BEING_GENERATED.getCode();
String errorMsg = GlobalResponseCodeConstants.BEING_GENERATED.getMsg();
......
......@@ -8,9 +8,9 @@ package com.luhu.computility.module.external.eums;
public interface DictDataConstants {
String VIDEO_SUFFIX = "video_suffix";
String VIDEO_SUFFIX = "";
String IMAGE_SUFFIX = "image_suffix";
String IMAGE_SUFFIX = "";
}
......@@ -39,9 +39,12 @@ public class TtsWebSocketDemo extends WebSocketListener {
*/
public static String tokenUrl = "https://openapi.data-baker.com/oauth/2.0/token?grant_type=client_credentials&client_secret=%s&client_id=%s";
private static final String hostUrl = "ws://127.0.0.1:48080/ws/wsapi";
//private static final String hostUrl = "ws://127.0.0.1:48080/ws/wsapi";
//private static final String hostUrl = "ws://42.192.64.253:58080/ws/wsapi";
private static final String hostUrl = "wss://ric.admin.lijinqi.com/ws/wsapi";
//private static final String hostUrl = "ws://42.192.64.253:48080/ws/wsapi";
private static final SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss.SSS");
......
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