Merge remote-tracking branch 'origin/develop' into dev/dev

# Conflicts:
#	src/main/resources/application-prod.properties
This commit is contained in:
2024-01-02 13:05:06 +08:00
6 changed files with 22 additions and 17 deletions

View File

@@ -72,7 +72,7 @@ public class DesignDetailController {
return response; return response;
} }
@ApiOperation(value = "编辑图层大小和位置") @ApiOperation(value = "编辑图层大小和位置 废弃")
@PostMapping("/editLayers") @PostMapping("/editLayers")
public Response<ComposeLayersVO> editPositionAndScale(@Valid @RequestBody EditLayersPositionAndScaleVO positionAndScaleVO) throws IOException { public Response<ComposeLayersVO> editPositionAndScale(@Valid @RequestBody EditLayersPositionAndScaleVO positionAndScaleVO) throws IOException {
return Response.success(designItemService.editLayersPositionAndScale(positionAndScaleVO)); return Response.success(designItemService.editLayersPositionAndScale(positionAndScaleVO));

View File

@@ -28,7 +28,7 @@ public class GenerateController {
@Resource @Resource
private GenerateService generateService; private GenerateService generateService;
@ApiOperation("自动识别sketch的caption") @ApiOperation("自动识别sketch的caption 暂时未上")
@PostMapping("/caption") @PostMapping("/caption")
public Response<GenerateCaptionVO> generateCaption(@RequestParam Long sketchElementId) { public Response<GenerateCaptionVO> generateCaption(@RequestParam Long sketchElementId) {
return Response.success(generateService.generateCaption(sketchElementId)); return Response.success(generateService.generateCaption(sketchElementId));

View File

@@ -55,11 +55,13 @@ public class PythonService {
private DesignHistoryService designHistoryService; private DesignHistoryService designHistoryService;
@Value("${access.python.ip:''}") @Value("${access.python.ip:''}")
private String accessPythonIp; private String accessPythonIp;
@Value("${access.python.port:''}")
private String accessPythonPort;
@Resource @Resource
private PythonTAllInfoService pythonTAllInfoService; private PythonTAllInfoService pythonTAllInfoService;
/** /**
* 生成打印的图片 二合一 * 生成打印的图片 二合一 (废弃于2024/01/02)
* *
* @param printPath * @param printPath
* @return * @return
@@ -83,7 +85,7 @@ public class PythonService {
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content)); RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content));
Request request = new Request.Builder() Request request = new Request.Builder()
// .url(accessPythonIp + ":9999/aifda/api/v1.0/fusion_test") // .url(accessPythonIp + ":9999/aifda/api/v1.0/fusion_test")
.url(accessPythonIp + ":9991/api/image_fusion") .url(accessPythonIp + ":" + accessPythonPort + "/api/image_fusion")
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
.addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
@@ -1684,7 +1686,7 @@ public class PythonService {
log.info("design请求python 参数:####{}", param); log.info("design请求python 参数:####{}", param);
RequestBody body = RequestBody.create(mediaType, param); RequestBody body = RequestBody.create(mediaType, param);
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://18.167.251.121:9991/api/design") .url(accessPythonIp + ":" + accessPythonPort + "/api/design")
// .url(accessPythonIp + ":10200/aifda/api/v1.0/generate") // .url(accessPythonIp + ":10200/aifda/api/v1.0/generate")
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
@@ -1717,7 +1719,7 @@ public class PythonService {
} }
/** /**
* 生成高级图片 * 生成高级图片(废弃)
* *
* @param designPath * @param designPath
* @return * @return
@@ -1790,7 +1792,7 @@ public class PythonService {
System.out.println(JSON.toJSONString(content)); System.out.println(JSON.toJSONString(content));
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content)); RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content));
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://18.167.251.121:9991/api/attribute_retrieve") .url(accessPythonIp + ":" + accessPythonPort + "/api/attribute_retrieve")
// .url(accessPythonIp+":9991/aifda/api/v1.0/attribute_retrieval") // .url(accessPythonIp+":9991/aifda/api/v1.0/attribute_retrieval")
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
@@ -2155,7 +2157,7 @@ public class PythonService {
log.info("design请求python 参数:####{}", param); log.info("design请求python 参数:####{}", param);
RequestBody body = RequestBody.create(mediaType, param); RequestBody body = RequestBody.create(mediaType, param);
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://18.167.251.121:9991/api/design") .url(accessPythonIp + ":" + accessPythonPort + "/api/design")
// .url(accessPythonIp + ":10200/aifda/api/v1.0/generate") // .url(accessPythonIp + ":10200/aifda/api/v1.0/generate")
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
@@ -2191,7 +2193,7 @@ public class PythonService {
throw new BusinessException("design.interface.exception"); throw new BusinessException("design.interface.exception");
} }
/** 暂时未用 */
public String generateSketchCaption(String url) { public String generateSketchCaption(String url) {
//限流校验 //限流校验
AccessLimitUtils.validate("generateSketchCaption", 5); AccessLimitUtils.validate("generateSketchCaption", 5);
@@ -2204,7 +2206,7 @@ public class PythonService {
MediaType mediaType = MediaType.parse("application/json"); MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, url); RequestBody body = RequestBody.create(mediaType, url);
Request request = new Request.Builder() Request request = new Request.Builder()
.url(accessPythonIp + ":2828/aida/interrogator") .url(accessPythonIp + ":" + accessPythonPort + "/aida/interrogator")
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
.addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
@@ -2250,13 +2252,13 @@ public class PythonService {
content.put("category", category); content.put("category", category);
content.put("mode", mode); content.put("mode", mode);
content.put("str", text); content.put("str", text);
content.put("version", modelName); content.put("version", "1");
content.put("gender", gender); content.put("gender", gender);
RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content, SerializerFeature.WriteMapNullValue)); RequestBody body = RequestBody.create(mediaType, JSON.toJSONString(content, SerializerFeature.WriteMapNullValue));
Request request = new Request.Builder() Request request = new Request.Builder()
// .url(accessPythonIp + ":2828/aida/diffusion") // .url(accessPythonIp + ":2828/aida/diffusion")
// .url("http://18.167.251.121:9992") // .url("http://18.167.251.121:9992")
.url("http://18.167.251.121:9991/api/diffusion") .url(accessPythonIp + ":" + accessPythonPort + "/api/diffusion")
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
.addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
@@ -2309,7 +2311,7 @@ public class PythonService {
MediaType mediaType = MediaType.parse("application/json"); MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, content); RequestBody body = RequestBody.create(mediaType, content);
Request request = new Request.Builder() Request request = new Request.Builder()
.url("http://18.167.251.121" + ":" + portAndRoute) .url(accessPythonIp + ":" + accessPythonPort + portAndRoute)
.method("POST", body) .method("POST", body)
.addHeader("Authorization", "Basic YWlkbGFiOjEyMw==") .addHeader("Authorization", "Basic YWlkbGFiOjEyMw==")
.addHeader("Content-Type", "application/json") .addHeader("Content-Type", "application/json")
@@ -2345,7 +2347,7 @@ public class PythonService {
String jsonString = JSON.toJSONString(content, SerializerFeature.WriteNullStringAsEmpty); String jsonString = JSON.toJSONString(content, SerializerFeature.WriteNullStringAsEmpty);
// todo 添加限流 // todo 添加限流
Response response = this.sendPostToModel(jsonString, "9991/api/preview_control", "composeLayers"); Response response = this.sendPostToModel(jsonString, "/api/preview_control", "composeLayers");
// todo 结束限流 // todo 结束限流
String bodyString; String bodyString;
@@ -2386,7 +2388,7 @@ public class PythonService {
String jsonString = JSON.toJSONString(contents, SerializerFeature.WriteNullStringAsEmpty); String jsonString = JSON.toJSONString(contents, SerializerFeature.WriteNullStringAsEmpty);
// todo 添加限流 // todo 添加限流
Response response = this.sendPostToModel(jsonString, "9991/api/category_recognition", "getClothCategory"); Response response = this.sendPostToModel(jsonString, "/api/category_recognition", "getClothCategory");
// todo 结束限流 // todo 结束限流
String bodyString; String bodyString;

View File

@@ -105,7 +105,7 @@ public class GenerateServiceImpl extends ServiceImpl<GenerateMapper, Generate> i
GenerateModeEnum.TEXT_IMAGE.getCode(); GenerateModeEnum.TEXT_IMAGE.getCode();
String category = generateThroughImageTextDTO.getLevel1Type().equals(SKETCH_BOARD.getRealName()) ? "sketch" : String category = generateThroughImageTextDTO.getLevel1Type().equals(SKETCH_BOARD.getRealName()) ? "sketch" :
generateThroughImageTextDTO.getLevel1Type().equals(PRINT_BOARD.getRealName()) ? "print" : "moodboard"; generateThroughImageTextDTO.getLevel1Type().equals(PRINT_BOARD.getRealName()) ? "print" : "moodboard";
text = !StringUtil.isNullOrEmpty(text) && generateThroughImageTextDTO.getVersion().equals("1") ? "painting style, " + text : text; // text = !StringUtil.isNullOrEmpty(text) && generateThroughImageTextDTO.getVersion().equals("1") ? "painting style, " + text : text;
List<String> generatedSketchUrl = pythonService.generateSketchOrPrint(accountId, Objects.isNull(elementId) ? null : collectionElement.getUrl(), List<String> generatedSketchUrl = pythonService.generateSketchOrPrint(accountId, Objects.isNull(elementId) ? null : collectionElement.getUrl(),
category, text, mode, generateThroughImageTextDTO.getVersion(), generateThroughImageTextDTO.getGender()); category, text, mode, generateThroughImageTextDTO.getVersion(), generateThroughImageTextDTO.getGender());

View File

@@ -42,6 +42,7 @@ spring.servlet.multipart.max-request-size= 5MB
#access.python.ip=http://43.198.80.117 #access.python.ip=http://43.198.80.117
access.python.ip=http://18.167.251.121 access.python.ip=http://18.167.251.121
#access.python.ip=http://18.167.251.121:9991/ #access.python.ip=http://18.167.251.121:9991/
access.python.port=9992
minio.endpoint=https://www.minio.aida.com.hk:9000 minio.endpoint=https://www.minio.aida.com.hk:9000
minio.accessKey=admin minio.accessKey=admin
@@ -51,3 +52,4 @@ minio.bucketName.mannequins=aida-mannequins
minio.bucketName.results=aida-results minio.bucketName.results=aida-results
minio.bucketName.sysImage=aida-sys-image minio.bucketName.sysImage=aida-sys-image
minio.bucketName.users=aida-users minio.bucketName.users=aida-users
minio.bucketName.collectionElement=aida-collection-element

View File

@@ -50,6 +50,7 @@ spring.servlet.multipart.max-request-size= 5MB
#access.python.ip=http://43.198.80.117 #access.python.ip=http://43.198.80.117
access.python.ip=http://18.167.251.121 access.python.ip=http://18.167.251.121
#access.python.ip=http://18.167.251.121:9991/ #access.python.ip=http://18.167.251.121:9991/
access.python.port=9991
# minIO服务配置之信息 # minIO服务配置之信息
minio.endpoint=https://www.minio.aida.com.hk:9000 minio.endpoint=https://www.minio.aida.com.hk:9000