Merge branch 'dev/dev-ltx' into dev/dev
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.aida.lanecarford.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 换脸API配置类
|
||||
*/
|
||||
@Data
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "faceswap.api")
|
||||
public class FaceSwapConfig {
|
||||
|
||||
/**
|
||||
* API基础URL
|
||||
*/
|
||||
private String baseUrl;
|
||||
|
||||
/**
|
||||
* 换脸接口端点
|
||||
*/
|
||||
private String refaceEndpoint;
|
||||
|
||||
/**
|
||||
* 获取完整的换脸API URL
|
||||
* @return 完整的API URL
|
||||
*/
|
||||
public String getRefaceUrl() {
|
||||
return baseUrl + refaceEndpoint;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.aida.lanecarford.service.impl;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.aida.lanecarford.common.CommonConstant;
|
||||
import com.aida.lanecarford.config.MinioConfig;
|
||||
import com.aida.lanecarford.config.FaceSwapConfig;
|
||||
import com.aida.lanecarford.common.response.ResultEnum;
|
||||
import com.aida.lanecarford.common.constant.MinioFileConstants;
|
||||
import com.aida.lanecarford.entity.*;
|
||||
@@ -52,6 +53,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
|
||||
private final MinioUtil minioUtil;
|
||||
private final MinioConfig minioConfig;
|
||||
private final FaceSwapConfig faceSwapConfig;
|
||||
|
||||
@Override
|
||||
public TryOnResultVo generateTryOnEffect(TryOnEffect tryOnEffectDto) {
|
||||
@@ -559,7 +561,7 @@ public class TryOnEffectServiceImpl extends ServiceImpl<TryOnEffectMapper, TryOn
|
||||
requestBody.put("threshold", 0.2);
|
||||
|
||||
// 调用换脸API
|
||||
String response = sendFaceSwapRequest("http://18.167.251.121:10004/api/v1/reface", requestBody.toString());
|
||||
String response = sendFaceSwapRequest(faceSwapConfig.getRefaceUrl(), requestBody.toString());
|
||||
|
||||
// 处理响应
|
||||
return processFaceSwapResponse(response);
|
||||
|
||||
Reference in New Issue
Block a user