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
ef5d1032
authored
Mar 24, 2026
by
lijinqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ai换脸图片,上传定时任务修改;
parent
ecb6cefd
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
40 additions
and
8 deletions
+40
-8
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/admin/file/vo/AiGeneratedFileSaveReqVO.java
+4
-0
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/OpenApiController.java
+4
-2
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/service/OpenApiService.java
+1
-1
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/service/OpenApiServiceImpl.java
+18
-2
computility-module-external/src/main/java/com/luhu/computility/module/external/dal/dataobject/file/AiGeneratedFileDO.java
+5
-0
computility-module-external/src/main/java/com/luhu/computility/module/external/job/UpdateAiGeneratedFileStatusJob.java
+5
-1
computility-server/src/main/resources/application.yaml
+3
-2
No files found.
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/admin/file/vo/AiGeneratedFileSaveReqVO.java
View file @
ef5d1032
...
...
@@ -30,4 +30,8 @@ public class AiGeneratedFileSaveReqVO {
private
String
coverImage
;
@Schema
(
description
=
"进度消息"
)
private
String
message
;
}
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/OpenApiController.java
View file @
ef5d1032
...
...
@@ -20,6 +20,7 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Parameters
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
me.zhyd.oauth.log.Log
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -88,12 +89,13 @@ public class OpenApiController {
@RequestParam
(
value
=
"sourceImageUrl"
,
required
=
false
)
String
sourceImageUrl
,
@RequestPart
(
value
=
"targetImage"
,
required
=
false
)
MultipartFile
targetImage
,
@RequestParam
(
value
=
"targetImageUrl"
,
required
=
false
)
String
targetImageUrl
)
{
Log
.
error
(
"ai换脸-图片换脸"
);
return
openApiService
.
faceImageGenerate
(
sourceImage
,
sourceImageUrl
,
targetImage
,
targetImageUrl
);
}
@ApiAccessLog
@
Ge
tMapping
(
"/view-image"
)
@
Pos
tMapping
(
"/view-image"
)
@Operation
(
summary
=
"根据promptId取换脸后的图"
,
description
=
"根据promptId取换脸后的图"
)
@ApiSignature
public
CommonResult
<
ViewSourceRespDTO
>
viewImage
(
@RequestBody
ViewImageReqDTO
viewImageReqDTO
){
...
...
@@ -116,7 +118,7 @@ public class OpenApiController {
@ApiAccessLog
@
Ge
tMapping
(
"/view-video"
)
@
Pos
tMapping
(
"/view-video"
)
@Operation
(
summary
=
"根据promptId取最后生成的视频"
,
description
=
"根据promptId取最后生成的视频"
)
@ApiSignature
public
CommonResult
<
ViewSourceRespDTO
>
viewVideo
(
@RequestBody
ViewVideoReqDTO
viewVideoReqDTO
){
...
...
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/service/OpenApiService.java
View file @
ef5d1032
...
...
@@ -55,7 +55,7 @@ public interface OpenApiService {
SseEmitter
aliyunStreamChat
(
AIQAReqDTO
aiqaReqDTO
);
String
getSourceUrl
(
String
promptId
,
Integer
type
);
String
getSourceUrl
(
Integer
id
,
String
promptId
,
Integer
type
);
}
computility-module-external/src/main/java/com/luhu/computility/module/external/controller/openapi/service/OpenApiServiceImpl.java
View file @
ef5d1032
...
...
@@ -48,6 +48,7 @@ import com.luhu.computility.module.external.eums.DictDataConstants;
import
com.luhu.computility.module.external.eums.DictTypeConstants
;
import
com.luhu.computility.module.external.service.file.AiGeneratedFileService
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhyd.oauth.log.Log
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -119,6 +120,10 @@ public class OpenApiServiceImpl implements OpenApiService {
@Value
(
"${swap-face.aliyun-stream-chat}"
)
private
String
aliyunStreamchat
;
@Value
(
"${swap-face.download-image}"
)
private
String
downloadFile
;
@Autowired
private
SSEService
sseService
;
...
...
@@ -568,7 +573,7 @@ public class OpenApiServiceImpl implements OpenApiService {
@Override
public
String
getSourceUrl
(
String
promptId
,
Integer
type
)
{
public
String
getSourceUrl
(
Integer
id
,
String
promptId
,
Integer
type
)
{
try
{
Map
<
String
,
String
>
queryParams
=
new
HashMap
<>();
queryParams
.
put
(
"promptId"
,
promptId
);
...
...
@@ -579,10 +584,21 @@ public class OpenApiServiceImpl implements OpenApiService {
result
=
HttpUtils
.
get
(
viewImageUrl
,
null
,
queryParams
);
}
CommonResult
<
ViewSourceRespDTO
>
viewVideoRespDTOCommonResult
=
handleJsonObjectResult
(
result
,
ViewSourceRespDTO
.
class
);
aiGeneratedFileService
.
updateAiGeneratedFile
(
new
AiGeneratedFileSaveReqVO
()
.
setId
(
id
)
.
setMessage
(
viewVideoRespDTOCommonResult
.
getMsg
()));
if
(
viewVideoRespDTOCommonResult
.
getCode
()
==
10001
)
{
Log
.
error
(
"换脸工作流还在进行,请稍后再试"
);
}
else
if
(
viewVideoRespDTOCommonResult
.
getCode
()
==
0
)
{
return
viewVideoRespDTOCommonResult
.
getData
().
getUrl
();
}
else
{
return
null
;
}
}
catch
(
Exception
e
)
{
return
"获资源地址异常"
;
Log
.
error
(
"换脸获资源地址异常:"
+
e
.
toString
());
return
null
;
}
return
null
;
}
}
computility-module-external/src/main/java/com/luhu/computility/module/external/dal/dataobject/file/AiGeneratedFileDO.java
View file @
ef5d1032
...
...
@@ -60,4 +60,9 @@ public class AiGeneratedFileDO extends BaseDO {
*/
private
String
coverImage
;
/**
* 进度消息
*/
private
String
message
;
}
computility-module-external/src/main/java/com/luhu/computility/module/external/job/UpdateAiGeneratedFileStatusJob.java
View file @
ef5d1032
...
...
@@ -14,6 +14,7 @@ import com.luhu.computility.module.external.controller.openapi.service.OpenApiSe
import
com.luhu.computility.module.external.dal.dataobject.file.AiGeneratedFileDO
;
import
com.luhu.computility.module.external.service.file.AiGeneratedFileService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
...
...
@@ -37,6 +38,9 @@ public class UpdateAiGeneratedFileStatusJob implements JobHandler {
private
OpenApiService
openApiService
;
@Value
(
"${swap-face.download-image}"
)
private
String
downloadImage
;
@Override
@TenantIgnore
public
String
execute
(
String
param
)
{
...
...
@@ -44,7 +48,7 @@ public class UpdateAiGeneratedFileStatusJob implements JobHandler {
int
num
=
0
;
if
(!
CollectionUtil
.
isEmpty
(
aiGeneratedFileList
)){
for
(
AiGeneratedFileDO
aiGeneratedFileDO
:
aiGeneratedFileList
)
{
String
originalUrl
=
openApiService
.
getSourceUrl
(
aiGeneratedFileDO
.
getPromptId
(),
aiGeneratedFileDO
.
getType
());
String
originalUrl
=
openApiService
.
getSourceUrl
(
aiGeneratedFileDO
.
get
Id
(),
aiGeneratedFileDO
.
get
PromptId
(),
aiGeneratedFileDO
.
getType
());
if
(!
ObjectUtil
.
isEmpty
(
originalUrl
))
{
aiGeneratedFileService
.
updateAiGeneratedFile
(
new
AiGeneratedFileSaveReqVO
()
.
setId
(
aiGeneratedFileDO
.
getId
())
...
...
computility-server/src/main/resources/application.yaml
View file @
ef5d1032
...
...
@@ -390,11 +390,11 @@ digital-human-zhuxi:
token
:
Basic emh1eGlAdHhnOndBSmNETDRMZVZ3QjlhdlV1OVJN
similar-image
:
base-url
:
http
://218.77.58.42:18088/
base-url
:
http
s://218.77.58.42:18088
match-mage
:
${similar-image.base-url}/matchImage
swap-face
:
base-url
:
http://218.77.58.42:18088
base-url
:
http
s
://218.77.58.42:18088
upload-image
:
${swap-face.base-url}/uploadFaceSwapImage
create-video-stream
:
${swap-face.base-url}/reActorFaceSwap
view-video
:
${swap-face.base-url}/viewVideo
...
...
@@ -404,6 +404,7 @@ swap-face:
AIQA-chat
:
${swap-face.base-url}/v1/AIQA-chat
AIQA-stream-chat
:
${swap-face.base-url}/v1/AIQA-stream-chat
aliyun-stream-chat
:
${swap-face.base-url}/v1/aliyun-ai-chat
download-image
:
${swap-face.base-url}/downloadImage?promptId=
new-aigc
:
...
...
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