Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
27e13e98
authored
Apr 09, 2026
by
lijinqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TTS websocket 完成
parent
9989e78b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
17 deletions
+10
-17
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/OpenApiController.java
+1
-9
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/service/OpenApiServiceImpl.java
+2
-4
computility-module-external/src/main/java/com/luhu/computility/module/external/eums/DictDataConstants.java
+2
-2
computility-module-external/src/main/java/com/luhu/computility/module/external/test/TtsWebSocketDemo.java
+5
-2
No files found.
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/OpenApiController.java
View file @
27e13e98
...
@@ -43,7 +43,6 @@ public class OpenApiController {
...
@@ -43,7 +43,6 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@PostMapping
(
value
=
"/digital-human-conversation"
)
@PostMapping
(
value
=
"/digital-human-conversation"
)
@Operation
(
summary
=
"数字人对话"
,
description
=
"和数字人朱熹进行一问一答的对话"
)
@Operation
(
summary
=
"数字人对话"
,
description
=
"和数字人朱熹进行一问一答的对话"
)
@ApiSignature
public
CommonResult
<
ConversationRespDTO
>
digitalHumanConversation
(
@RequestBody
ConversationReqDTO
conversationReqDTO
){
public
CommonResult
<
ConversationRespDTO
>
digitalHumanConversation
(
@RequestBody
ConversationReqDTO
conversationReqDTO
){
return
openApiService
.
digitalHumanConversation
(
conversationReqDTO
);
return
openApiService
.
digitalHumanConversation
(
conversationReqDTO
);
}
}
...
@@ -56,7 +55,6 @@ public class OpenApiController {
...
@@ -56,7 +55,6 @@ public class OpenApiController {
@Parameter
(
name
=
"url"
,
description
=
"图片链接"
)
@Parameter
(
name
=
"url"
,
description
=
"图片链接"
)
})
})
@Operation
(
summary
=
"ai换脸-上传图片"
,
description
=
"用户上传头像将视频中人物头像替换"
)
@Operation
(
summary
=
"ai换脸-上传图片"
,
description
=
"用户上传头像将视频中人物头像替换"
)
@ApiSignature
public
CommonResult
<
UploadImageRespDTO
>
uploadFaceSwapImage
(
@RequestPart
(
value
=
"image"
,
required
=
false
)
MultipartFile
image
,
public
CommonResult
<
UploadImageRespDTO
>
uploadFaceSwapImage
(
@RequestPart
(
value
=
"image"
,
required
=
false
)
MultipartFile
image
,
@RequestParam
(
value
=
"url"
,
required
=
false
)
String
url
)
{
@RequestParam
(
value
=
"url"
,
required
=
false
)
String
url
)
{
return
openApiService
.
uploadFaceSwapImage
(
image
,
url
);
return
openApiService
.
uploadFaceSwapImage
(
image
,
url
);
...
@@ -66,7 +64,6 @@ public class OpenApiController {
...
@@ -66,7 +64,6 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@GetMapping
(
"/create-video-stream"
)
@GetMapping
(
"/create-video-stream"
)
@Operation
(
summary
=
"ai换脸-生成换脸工作流"
,
description
=
"只有先上传图片才能开始换脸工作流,用户根据promptId取最后生成的视频"
)
@Operation
(
summary
=
"ai换脸-生成换脸工作流"
,
description
=
"只有先上传图片才能开始换脸工作流,用户根据promptId取最后生成的视频"
)
@ApiSignature
public
CommonResult
<
CeateVideoStreamRespDTO
>
ceateVideoStream
(
@RequestBody
CeateVideoStreamReqDTO
ceateVideoStreamReqDTO
){
public
CommonResult
<
CeateVideoStreamRespDTO
>
ceateVideoStream
(
@RequestBody
CeateVideoStreamReqDTO
ceateVideoStreamReqDTO
){
return
openApiService
.
ceateVideoStream
(
ceateVideoStreamReqDTO
);
return
openApiService
.
ceateVideoStream
(
ceateVideoStreamReqDTO
);
}
}
...
@@ -75,7 +72,6 @@ public class OpenApiController {
...
@@ -75,7 +72,6 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@PostMapping
(
value
=
"/generate-face-swap-image"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@PostMapping
(
value
=
"/generate-face-swap-image"
,
consumes
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@Operation
(
summary
=
"ai换脸-图片换脸:上传图+图片生成"
,
description
=
"ai换脸-图片换脸:上传图片+图片生成"
)
@Operation
(
summary
=
"ai换脸-图片换脸:上传图+图片生成"
,
description
=
"ai换脸-图片换脸:上传图片+图片生成"
)
@ApiSignature
public
CommonResult
<
GenerateFaceSwapRespDTO
>
faceImageGenerate
(
@RequestPart
(
value
=
"sourceImage"
,
required
=
false
)
MultipartFile
sourceImage
,
public
CommonResult
<
GenerateFaceSwapRespDTO
>
faceImageGenerate
(
@RequestPart
(
value
=
"sourceImage"
,
required
=
false
)
MultipartFile
sourceImage
,
@RequestParam
(
value
=
"sourceImageUrl"
,
required
=
false
)
String
sourceImageUrl
,
@RequestParam
(
value
=
"sourceImageUrl"
,
required
=
false
)
String
sourceImageUrl
,
@RequestPart
(
value
=
"targetImage"
,
required
=
false
)
MultipartFile
targetImage
,
@RequestPart
(
value
=
"targetImage"
,
required
=
false
)
MultipartFile
targetImage
,
...
@@ -88,7 +84,6 @@ public class OpenApiController {
...
@@ -88,7 +84,6 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@PostMapping
(
"/view-image"
)
@PostMapping
(
"/view-image"
)
@Operation
(
summary
=
"根据promptId取换脸后的图"
,
description
=
"根据promptId取换脸后的图"
)
@Operation
(
summary
=
"根据promptId取换脸后的图"
,
description
=
"根据promptId取换脸后的图"
)
@ApiSignature
public
CommonResult
<
ViewSourceRespDTO
>
viewImage
(
@RequestBody
ViewImageReqDTO
viewImageReqDTO
){
public
CommonResult
<
ViewSourceRespDTO
>
viewImage
(
@RequestBody
ViewImageReqDTO
viewImageReqDTO
){
return
openApiService
.
viewImage
(
viewImageReqDTO
);
return
openApiService
.
viewImage
(
viewImageReqDTO
);
}
}
...
@@ -113,7 +108,6 @@ public class OpenApiController {
...
@@ -113,7 +108,6 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@PostMapping
(
"/view-video"
)
@PostMapping
(
"/view-video"
)
@Operation
(
summary
=
"根据promptId取最后生成的视频"
,
description
=
"根据promptId取最后生成的视频"
)
@Operation
(
summary
=
"根据promptId取最后生成的视频"
,
description
=
"根据promptId取最后生成的视频"
)
@ApiSignature
public
CommonResult
<
ViewSourceRespDTO
>
viewVideo
(
@RequestBody
ViewVideoReqDTO
viewVideoReqDTO
){
public
CommonResult
<
ViewSourceRespDTO
>
viewVideo
(
@RequestBody
ViewVideoReqDTO
viewVideoReqDTO
){
return
openApiService
.
viewVideo
(
viewVideoReqDTO
);
return
openApiService
.
viewVideo
(
viewVideoReqDTO
);
}
}
...
@@ -128,7 +122,6 @@ public class OpenApiController {
...
@@ -128,7 +122,6 @@ public class OpenApiController {
@Parameter
(
name
=
"touristAreaId"
,
description
=
"景点编码"
)
@Parameter
(
name
=
"touristAreaId"
,
description
=
"景点编码"
)
})
})
@Operation
(
summary
=
"图片拍照-相似图查找"
,
description
=
"图片拍照-相似图查找"
)
@Operation
(
summary
=
"图片拍照-相似图查找"
,
description
=
"图片拍照-相似图查找"
)
@ApiSignature
public
CommonResult
<
List
<
MatchImageRespDTO
>>
matchImage
(
@RequestPart
(
value
=
"image"
,
required
=
false
)
MultipartFile
image
public
CommonResult
<
List
<
MatchImageRespDTO
>>
matchImage
(
@RequestPart
(
value
=
"image"
,
required
=
false
)
MultipartFile
image
,
@RequestParam
(
value
=
"url"
,
required
=
false
)
String
url
,
@RequestParam
(
value
=
"url"
,
required
=
false
)
String
url
,
@RequestParam
(
value
=
"limit"
,
required
=
false
)
Integer
limit
,
@RequestParam
(
value
=
"limit"
,
required
=
false
)
Integer
limit
...
@@ -142,7 +135,7 @@ public class OpenApiController {
...
@@ -142,7 +135,7 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@PostMapping
(
"/AIQA-chat"
)
@PostMapping
(
"/AIQA-chat"
)
@Operation
(
summary
=
"AI问答"
,
description
=
"AI助手,关于行程和景区的疑问"
)
@Operation
(
summary
=
"AI问答"
,
description
=
"AI助手,关于行程和景区的疑问"
)
@ApiSignature
//
@ApiSignature
public
CommonResult
<
AIQARespDTO
>
AIQAChat
(
@RequestBody
AIQAReqDTO
aiqaReqDTO
){
public
CommonResult
<
AIQARespDTO
>
AIQAChat
(
@RequestBody
AIQAReqDTO
aiqaReqDTO
){
return
openApiService
.
AIQAChat
(
aiqaReqDTO
);
return
openApiService
.
AIQAChat
(
aiqaReqDTO
);
}
}
...
@@ -168,7 +161,6 @@ public class OpenApiController {
...
@@ -168,7 +161,6 @@ public class OpenApiController {
@ApiAccessLog
@ApiAccessLog
@PostMapping
(
value
=
"/glm-stream-chat"
,
produces
=
MediaType
.
TEXT_EVENT_STREAM_VALUE
)
@PostMapping
(
value
=
"/glm-stream-chat"
,
produces
=
MediaType
.
TEXT_EVENT_STREAM_VALUE
)
@Operation
(
summary
=
"智谱GLM流式-自定义messages"
,
description
=
"调用方自定义messages数组"
)
@Operation
(
summary
=
"智谱GLM流式-自定义messages"
,
description
=
"调用方自定义messages数组"
)
@ApiSignature
public
SseEmitter
glmStreamChat
(
@RequestBody
ZhipuChatReqDTO
zhipuChatReqDTO
)
{
public
SseEmitter
glmStreamChat
(
@RequestBody
ZhipuChatReqDTO
zhipuChatReqDTO
)
{
return
openApiService
.
zhipuStreamChat
(
zhipuChatReqDTO
);
return
openApiService
.
zhipuStreamChat
(
zhipuChatReqDTO
);
}
}
...
...
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/service/OpenApiServiceImpl.java
View file @
27e13e98
...
@@ -317,10 +317,9 @@ public class OpenApiServiceImpl implements OpenApiService {
...
@@ -317,10 +317,9 @@ public class OpenApiServiceImpl implements OpenApiService {
aiGeneratedFileService
.
getAiGeneratedFileByPromptId
(
viewVideoReqDTO
.
getPromptId
());
aiGeneratedFileService
.
getAiGeneratedFileByPromptId
(
viewVideoReqDTO
.
getPromptId
());
if
(!
ObjectUtils
.
isEmpty
(
aiGeneratedFileDO
))
{
if
(!
ObjectUtils
.
isEmpty
(
aiGeneratedFileDO
))
{
if
(!
StringUtils
.
isEmpty
(
aiGeneratedFileDO
.
getUrl
()))
{
if
(!
StringUtils
.
isEmpty
(
aiGeneratedFileDO
.
getUrl
()))
{
String
videoSuffix
=
dictDataService
.
getDictData
(
DictTypeConstants
.
FILE_SUFFIX
,
DictDataConstants
.
VIDEO_SUFFIX
).
getLabel
();
return
success
(
new
ViewSourceRespDTO
()
return
success
(
new
ViewSourceRespDTO
()
.
setUrl
(
aiGeneratedFileDO
.
getUrl
())
.
setUrl
(
aiGeneratedFileDO
.
getUrl
())
.
setCoverImage
(
aiGeneratedFileDO
.
getUrl
()
+
videoSuffix
));
.
setCoverImage
(
aiGeneratedFileDO
.
getUrl
()
+
"?x-oss-process=video/snapshot,t_0,f_jpg"
));
}
else
{
}
else
{
String
errorMsg
=
aiGeneratedFileDO
.
getMessage
();
String
errorMsg
=
aiGeneratedFileDO
.
getMessage
();
if
(
aiGeneratedFileDO
.
getStatus
()
==
1
&&
StringUtils
.
isEmpty
(
errorMsg
))
{
if
(
aiGeneratedFileDO
.
getStatus
()
==
1
&&
StringUtils
.
isEmpty
(
errorMsg
))
{
...
@@ -352,10 +351,9 @@ public class OpenApiServiceImpl implements OpenApiService {
...
@@ -352,10 +351,9 @@ public class OpenApiServiceImpl implements OpenApiService {
aiGeneratedFileService
.
getAiGeneratedFileByPromptId
(
viewImageReqDTO
.
getPromptId
());
aiGeneratedFileService
.
getAiGeneratedFileByPromptId
(
viewImageReqDTO
.
getPromptId
());
if
(!
ObjectUtils
.
isEmpty
(
aiGeneratedFileDO
))
{
if
(!
ObjectUtils
.
isEmpty
(
aiGeneratedFileDO
))
{
if
(!
StringUtils
.
isEmpty
(
aiGeneratedFileDO
.
getUrl
()))
{
if
(!
StringUtils
.
isEmpty
(
aiGeneratedFileDO
.
getUrl
()))
{
String
imageSuffix
=
dictDataService
.
getDictData
(
DictTypeConstants
.
FILE_SUFFIX
,
DictDataConstants
.
IMAGE_SUFFIX
).
getLabel
();
return
success
(
new
ViewSourceRespDTO
()
return
success
(
new
ViewSourceRespDTO
()
.
setUrl
(
aiGeneratedFileDO
.
getUrl
())
.
setUrl
(
aiGeneratedFileDO
.
getUrl
())
.
setCoverImage
(
aiGeneratedFileDO
.
getUrl
()
+
imageSuffix
));
.
setCoverImage
(
aiGeneratedFileDO
.
getUrl
()));
}
else
{
}
else
{
Integer
errorCode
=
GlobalResponseCodeConstants
.
BEING_GENERATED
.
getCode
();
Integer
errorCode
=
GlobalResponseCodeConstants
.
BEING_GENERATED
.
getCode
();
String
errorMsg
=
GlobalResponseCodeConstants
.
BEING_GENERATED
.
getMsg
();
String
errorMsg
=
GlobalResponseCodeConstants
.
BEING_GENERATED
.
getMsg
();
...
...
computility-module-external/src/main/java/com/luhu/computility/module/external/eums/DictDataConstants.java
View file @
27e13e98
...
@@ -8,9 +8,9 @@ package com.luhu.computility.module.external.eums;
...
@@ -8,9 +8,9 @@ package com.luhu.computility.module.external.eums;
public
interface
DictDataConstants
{
public
interface
DictDataConstants
{
String
VIDEO_SUFFIX
=
"
video_suffix
"
;
String
VIDEO_SUFFIX
=
""
;
String
IMAGE_SUFFIX
=
"
image_suffix
"
;
String
IMAGE_SUFFIX
=
""
;
}
}
computility-module-external/src/main/java/com/luhu/computility/module/external/test/TtsWebSocketDemo.java
View file @
27e13e98
...
@@ -39,9 +39,12 @@ public class TtsWebSocketDemo extends WebSocketListener {
...
@@ -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"
;
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"
);
private
static
final
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyy-MM-dd HH:mm:ss.SSS"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment