From cbb5145123e3c31fee4992a57f4997d3d2cc0eb8 Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 20 Sep 2023 12:05:08 +0800 Subject: [PATCH] =?UTF-8?q?TASK:workspace=E3=80=81design=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E4=BB=A3=E7=A0=81;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/common/enums/DesignTypeEnum.java | 3 +- .../ai/da/controller/WorkspaceController.java | 33 +- .../da/mapper/entity/CollectionElement.java | 2 + src/main/java/com/ai/da/model/vo/ModelVO.java | 13 + .../java/com/ai/da/model/vo/ModelsVO.java | 14 + .../com/ai/da/model/vo/ValidateElementVO.java | 2 + .../java/com/ai/da/python/PythonService.java | 31 +- .../com/ai/da/service/GenerateService.java | 5 +- .../com/ai/da/service/WorkspaceService.java | 3 + .../impl/CollectionElementServiceImpl.java | 65 ++- .../service/impl/DesignItemServiceImpl.java | 2 +- .../ai/da/service/impl/DesignServiceImpl.java | 486 ++++++++++-------- .../da/service/impl/LibraryServiceImpl.java | 62 ++- .../TDesignPythonOutfitDetailServiceImpl.java | 2 +- .../da/service/impl/WorkspaceServiceImpl.java | 256 +++++---- .../resources/application-prod.properties | 23 +- src/main/resources/application.properties | 2 +- 17 files changed, 621 insertions(+), 383 deletions(-) create mode 100644 src/main/java/com/ai/da/model/vo/ModelVO.java create mode 100644 src/main/java/com/ai/da/model/vo/ModelsVO.java diff --git a/src/main/java/com/ai/da/common/enums/DesignTypeEnum.java b/src/main/java/com/ai/da/common/enums/DesignTypeEnum.java index 8741961d..305d28f5 100644 --- a/src/main/java/com/ai/da/common/enums/DesignTypeEnum.java +++ b/src/main/java/com/ai/da/common/enums/DesignTypeEnum.java @@ -15,7 +15,8 @@ public enum DesignTypeEnum { /** * Library */ - LIBRARY("Library"); + LIBRARY("Library"), + GENERATE("Generate"); private String realName; diff --git a/src/main/java/com/ai/da/controller/WorkspaceController.java b/src/main/java/com/ai/da/controller/WorkspaceController.java index df52cf09..d2c630a5 100644 --- a/src/main/java/com/ai/da/controller/WorkspaceController.java +++ b/src/main/java/com/ai/da/controller/WorkspaceController.java @@ -3,8 +3,10 @@ package com.ai.da.controller; import com.ai.da.common.response.Response; import com.ai.da.common.utils.MinioUtil; import com.ai.da.mapper.entity.Workspace; +import com.ai.da.model.dto.ModelsDotDTO; import com.ai.da.model.dto.WorkspaceDTO; import com.ai.da.model.enums.BizJson; +import com.ai.da.model.vo.ModelsVO; import com.ai.da.model.vo.WorkspaceVO; import com.ai.da.service.WorkspaceService; import io.swagger.annotations.Api; @@ -38,29 +40,6 @@ public class WorkspaceController { @Resource private WorkspaceService workspaceService; - @Resource - private MinioUtil minIoUtil; - - @Value("${minio.endpoint}") - public String address; - - @Value("${minio.bucketName}") - public String bucketName; - - @PostMapping("/upload") - public Object upload(MultipartFile file) { - - List upload = minIoUtil.upload(new MultipartFile[]{file}); - - return address+"/"+bucketName+"/"+upload.get(0); - } - - @PostMapping("/getUrl") - public Object getUrl() { - - return minIoUtil.getPresignedUrl("test", "R-C_1694066189047.png", 5); - } - /** * 详情 */ @@ -112,5 +91,13 @@ public class WorkspaceController { return Response.success(bizJsonList); } + @GetMapping("/getMannequins") + @ApiOperationSupport(order = 6) + @ApiOperation(value = "获取模特") + public Response> getMannequins() { + List modelsVO = workspaceService.getMannequins(); + return Response.success(modelsVO); + } + } diff --git a/src/main/java/com/ai/da/mapper/entity/CollectionElement.java b/src/main/java/com/ai/da/mapper/entity/CollectionElement.java index ef291e37..68fdc5c3 100644 --- a/src/main/java/com/ai/da/mapper/entity/CollectionElement.java +++ b/src/main/java/com/ai/da/mapper/entity/CollectionElement.java @@ -41,6 +41,8 @@ public class CollectionElement implements Serializable { */ private Long collectionId; + private String type; + /** * 一级类型 */ diff --git a/src/main/java/com/ai/da/model/vo/ModelVO.java b/src/main/java/com/ai/da/model/vo/ModelVO.java new file mode 100644 index 00000000..40b67932 --- /dev/null +++ b/src/main/java/com/ai/da/model/vo/ModelVO.java @@ -0,0 +1,13 @@ +package com.ai.da.model.vo; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ModelVO { + private Long id; + private String url; +} diff --git a/src/main/java/com/ai/da/model/vo/ModelsVO.java b/src/main/java/com/ai/da/model/vo/ModelsVO.java new file mode 100644 index 00000000..80d4de37 --- /dev/null +++ b/src/main/java/com/ai/da/model/vo/ModelsVO.java @@ -0,0 +1,14 @@ +package com.ai.da.model.vo; + +import lombok.*; + +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ModelsVO { + + private List modelList; + private String type; +} diff --git a/src/main/java/com/ai/da/model/vo/ValidateElementVO.java b/src/main/java/com/ai/da/model/vo/ValidateElementVO.java index 040209b4..5dfc8dc8 100644 --- a/src/main/java/com/ai/da/model/vo/ValidateElementVO.java +++ b/src/main/java/com/ai/da/model/vo/ValidateElementVO.java @@ -28,6 +28,8 @@ public class ValidateElementVO { List usedElementIds = Lists.newArrayList(); //用于存储library 生成collection List libraryCollectionElements = Lists.newArrayList(); + //用于存储generate 生成collection + List generateCollectionElements = Lists.newArrayList(); //存储template打点数据 DesignLibraryModelPointVO designLibraryModelPoint =null; //存储本次design已经使用的上衣和下衣的的MD5list 去重用 diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index efd56bb5..8ff136d1 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -413,11 +413,14 @@ public class PythonService { private List calculatePythonItemHairstyleShoes(ValidateElementVO elementVO, DesignLibraryModelPointVO designLibraryModelPoint) { List items = Lists.newArrayList(); - DesignPythonItem.SYS_HAIRSTYLE_SHOES_BODY.forEach(type -> { - if (SingleOverallEnum.SINGLE.getRealName().equals(elementVO.getSingleOverall()) || Objects.nonNull(designLibraryModelPoint)){ + for (String type : DesignPythonItem.SYS_HAIRSTYLE_SHOES_BODY) { + if (!type.equals("Body")) { + continue; + } + if (SingleOverallEnum.SINGLE.getRealName().equals(elementVO.getSingleOverall()) || Objects.nonNull(designLibraryModelPoint)) { //single和models模特时候不传耳环 首饰,鞋子等 - if(!SysFileLevel2TypeEnum.BODY.getRealName().equals(type)){ - return; + if (!SysFileLevel2TypeEnum.BODY.getRealName().equals(type)) { + continue; } } DesignPythonItem pythonItem = new DesignPythonItem(); @@ -428,8 +431,8 @@ public class PythonService { if (Objects.nonNull(designLibraryModelPoint)) { pythonItem.setBody_path(designLibraryModelPoint.getTemplateUrl()); } else { -// pythonItem.setBody_path("/home/pangkaicheng/python_code/Multi-layer-Virtual-Try-on/dataset_for_test/Img_model.png"); - pythonItem.setBody_path("/workspace/python_code/Multi-layer-Virtual-Try-on/dataset_for_test/Img_model.png"); +// pythonItem.setBody_path("/workspace/python_code/Multi-layer-Virtual-Try-on/dataset_for_test/Img_model.png"); + pythonItem.setBody_path("aida-mannequins/model_1693218345.2714431.png"); } } else { SysFileVO sysFileVO = getRandomSysFileByLevel2Type(type, Lists.newArrayList()); @@ -439,7 +442,7 @@ public class PythonService { pythonItem.setColor(getRandomColor(elementVO.getColorBoards())); } } - }); + } return items; } @@ -800,9 +803,15 @@ public class PythonService { designPythonItemBlouse.setColor(getRandomColor(elementVO.getColorBoards())); if (!elementVO.getDesignPythonItemPrint().getPath().equals("none") && elementVO.getDesignPrintPictureTypeLayoutList().contains(type)) { - designPythonItemBlouse.setPrint(CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class)); + DesignPythonItemPrint designPythonItemPrint = CopyUtil.copyObject(elementVO.getDesignPythonItemPrint(), DesignPythonItemPrint.class); + designPythonItemPrint.setIfSingle(false); + designPythonItemPrint.setPrint_path_list(Collections.singletonList(designPythonItemPrint.getPath())); + designPythonItemBlouse.setPrint(designPythonItemPrint); } else { - designPythonItemBlouse.setPrint(new DesignPythonItemPrint("none")); + DesignPythonItemPrint designPythonItemPrint = new DesignPythonItemPrint(); + designPythonItemPrint.setIfSingle(false); + designPythonItemPrint.setPrint_path_list(new ArrayList<>()); + designPythonItemBlouse.setPrint(designPythonItemPrint); } return designPythonItemBlouse; } @@ -1530,10 +1539,6 @@ public class PythonService { MediaType mediaType = MediaType.parse("application/json"); //关闭FastJson的引用检测 防止出现$ref 现象 String param = JSON.toJSONString(designPythonObjects, SerializerFeature.DisableCircularReferenceDetect); -// String param = "{\"objects\":[{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/202308/userFile/collection/Sketchboard/42/048419db-38c4-4aee-85a7-33f0666b18d2.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/pythonFile/generatePrint/generatePrint-d7a67a96-83f9-429f-9028-3e1697501088.jpg\"},\"type\":\"Outwear\",\"image_id\":53547},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0628001153.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Skirt\",\"image_id\":53548},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_242.jpg\",\"type\":\"Hairstyle\",\"image_id\":411},{\"color\":\"31 76 171\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/dress/0902005000.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\"},\"type\":\"Dress\",\"image_id\":53549},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0825000582.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\"},\"type\":\"Skirt\",\"image_id\":53550},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2529.jpg\",\"type\":\"Hairstyle\",\"image_id\":898},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0628001185.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\"},\"type\":\"Outwear\",\"image_id\":53551},{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0628000635.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\"},\"type\":\"Trousers\",\"image_id\":53552},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2102.jpg\",\"type\":\"Hairstyle\",\"image_id\":471},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_41.jpg\",\"type\":\"Shoes\",\"image_id\":344},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"31 76 171\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902002198.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Outwear\",\"image_id\":53553},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0916000791.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Skirt\",\"image_id\":53554},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2518.jpg\",\"type\":\"Hairstyle\",\"image_id\":887},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_11.png\",\"type\":\"Earring\",\"image_id\":92},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902000892.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Outwear\",\"image_id\":53555},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0916000460.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Trousers\",\"image_id\":53556},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_204.jpg\",\"type\":\"Hairstyle\",\"image_id\":294},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002112.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Skirt\",\"image_id\":53558},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2186.jpg\",\"type\":\"Hairstyle\",\"image_id\":555},{\"color\":\"204 182 182\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002861.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Skirt\",\"image_id\":53560},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2128.jpg\",\"type\":\"Hairstyle\",\"image_id\":497},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_39.jpg\",\"type\":\"Shoes\",\"image_id\":192},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_4.png\",\"type\":\"Earring\",\"image_id\":86},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902000567.jpg\",\"print\":{\"path\":\"none\"},\"type\":\"Skirt\",\"image_id\":53562},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2357.jpg\",\"type\":\"Hairstyle\",\"image_id\":726},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_6.jpg\",\"type\":\"Shoes\",\"image_id\":163},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]}]}"; -// String param = "{\"objects\":[{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/202308/userFile/collection/Sketchboard/42/048419db-38c4-4aee-85a7-33f0666b18d2.jpg\",\"print\":{\"IfSingle\":false,\"level1Type\":\"Printboard\",\"location\":[],\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-14459173-d338-4425-8fcb-8755ceb254bc.jpg\",\"scale\":0.1},\"type\":\"Outwear\",\"image_id\":53547},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0628001153.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53548},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_242.jpg\",\"type\":\"Hairstyle\",\"image_id\":411},{\"color\":\"31 76 171\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/dress/0902005000.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\",\"IfSingle\":false},\"type\":\"Dress\",\"image_id\":53549},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0825000582.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53550},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2529.jpg\",\"type\":\"Hairstyle\",\"image_id\":898},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0628001185.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\"},\"type\":\"Outwear\",\"image_id\":53551},{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0628000635.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\"},\"type\":\"Trousers\",\"image_id\":53552},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2102.jpg\",\"type\":\"Hairstyle\",\"image_id\":471},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_41.jpg\",\"type\":\"Shoes\",\"image_id\":344},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"31 76 171\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902002198.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53553},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0916000791.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53554},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2518.jpg\",\"type\":\"Hairstyle\",\"image_id\":887},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_11.png\",\"type\":\"Earring\",\"image_id\":92},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902000892.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53555},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0916000460.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Trousers\",\"image_id\":53556},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_204.jpg\",\"type\":\"Hairstyle\",\"image_id\":294},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002112.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53558},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2186.jpg\",\"type\":\"Hairstyle\",\"image_id\":555},{\"color\":\"204 182 182\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002861.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53560},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2128.jpg\",\"type\":\"Hairstyle\",\"image_id\":497},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_39.jpg\",\"type\":\"Shoes\",\"image_id\":192},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_4.png\",\"type\":\"Earring\",\"image_id\":86},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902000567.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53562},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2357.jpg\",\"type\":\"Hairstyle\",\"image_id\":726},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_6.jpg\",\"type\":\"Shoes\",\"image_id\":163},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]}]}"; -// String param = "{\"objects\":[{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/202308/userFile/collection/Sketchboard/42/048419db-38c4-4aee-85a7-33f0666b18d2.jpg\",\"print\":{\"IfSingle\":false,\"level1Type\":\"Printboard\",\"location\":[],\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-14459173-d338-4425-8fcb-8755ceb254bc.jpg\",\"scale\":0.1},\"type\":\"Outwear\",\"image_id\":53547},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0628001153.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53548},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_242.jpg\",\"type\":\"Hairstyle\",\"image_id\":411},{\"color\":\"31 76 171\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/dress/0902005000.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\",\"IfSingle\":false},\"type\":\"Dress\",\"image_id\":53549},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0825000582.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53550},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2529.jpg\",\"type\":\"Hairstyle\",\"image_id\":898},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0628001185.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\"},\"type\":\"Outwear\",\"image_id\":53551},{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0628000635.jpg\",\"print\":{\"path\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\"},\"type\":\"Trousers\",\"image_id\":53552},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2102.jpg\",\"type\":\"Hairstyle\",\"image_id\":471},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_41.jpg\",\"type\":\"Shoes\",\"image_id\":344},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"31 76 171\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902002198.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53553},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0916000791.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53554},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2518.jpg\",\"type\":\"Hairstyle\",\"image_id\":887},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_11.png\",\"type\":\"Earring\",\"image_id\":92},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902000892.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53555},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0916000460.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Trousers\",\"image_id\":53556},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_204.jpg\",\"type\":\"Hairstyle\",\"image_id\":294},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002112.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53558},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2186.jpg\",\"type\":\"Hairstyle\",\"image_id\":555},{\"color\":\"204 182 182\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002861.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53560},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2128.jpg\",\"type\":\"Hairstyle\",\"image_id\":497},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_39.jpg\",\"type\":\"Shoes\",\"image_id\":192},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_4.png\",\"type\":\"Earring\",\"image_id\":86},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902000567.jpg\",\"print\":{\"path\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53562},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2357.jpg\",\"type\":\"Hairstyle\",\"image_id\":726},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_6.jpg\",\"type\":\"Shoes\",\"image_id\":163},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]}]}"; -// String param = "{\"objects\":[{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/202308/userFile/collection/Sketchboard/42/048419db-38c4-4aee-85a7-33f0666b18d2.jpg\",\"print\":{\"IfSingle\":false,\"level1Type\":\"Printboard\",\"location\":[],\"print_path_list\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-14459173-d338-4425-8fcb-8755ceb254bc.jpg\",\"scale\":0.1},\"type\":\"Outwear\",\"image_id\":53547},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0628001153.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53548},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_242.jpg\",\"type\":\"Hairstyle\",\"image_id\":411},{\"color\":\"31 76 171\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/dress/0902005000.jpg\",\"print\":{\"print_path_list\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\",\"IfSingle\":false},\"type\":\"Dress\",\"image_id\":53549},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0825000582.jpg\",\"print\":{\"print_path_list\":\"https://www.aida.com.hk/download/202304/userFile/library/Printboard/42/4ba535c2-a08b-4114-826b-a87885fd3623Fabric-03.png\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53550},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2529.jpg\",\"type\":\"Hairstyle\",\"image_id\":898},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0628001185.jpg\",\"print\":{\"print_path_list\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53551},{\"color\":\"103 74 74\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0628000635.jpg\",\"print\":{\"print_path_list\":\"https://www.aida.com.hk/download/202308/pythonFile/generatePrint/generatePrint-487e93e6-1e21-46b8-b821-3188251dbdbc.jpg\",\"IfSingle\":false},\"type\":\"Trousers\",\"image_id\":53552},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2102.jpg\",\"type\":\"Hairstyle\",\"image_id\":471},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_41.jpg\",\"type\":\"Shoes\",\"image_id\":344},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"31 76 171\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902002198.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53553},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0916000791.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53554},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2518.jpg\",\"type\":\"Hairstyle\",\"image_id\":887},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_11.png\",\"type\":\"Earring\",\"image_id\":92},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/outwear/0902000892.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Outwear\",\"image_id\":53555},{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/trousers/0916000460.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Trousers\",\"image_id\":53556},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_204.jpg\",\"type\":\"Hairstyle\",\"image_id\":294},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_15.png\",\"type\":\"Shoes\",\"image_id\":171},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_5.png\",\"type\":\"Earring\",\"image_id\":87},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"50 187 147\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002112.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53558},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2186.jpg\",\"type\":\"Hairstyle\",\"image_id\":555},{\"color\":\"204 182 182\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_11.jpg\",\"type\":\"Shoes\",\"image_id\":167},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_12.png\",\"type\":\"Earring\",\"image_id\":93},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"137 50 50\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902002861.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53560},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2128.jpg\",\"type\":\"Hairstyle\",\"image_id\":497},{\"color\":\"49 127 162\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_39.jpg\",\"type\":\"Shoes\",\"image_id\":192},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_4.png\",\"type\":\"Earring\",\"image_id\":86},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]},{\"basic\":{\"body_point_test\":{\"shoulder_left\":[755,519],\"toe_right\":[850,1355],\"ear_point_left\":[802,439],\"shoulder_right\":[912,519],\"waistband_right\":[891,725],\"hand_point_right\":[915,886],\"waistband_left\":[777,725],\"hand_point_left\":[754,886],\"head_point_left\":[804,424],\"head_point_right\":[864,424],\"ear_point_right\":[865,438],\"toe_left\":[817,1355],\"foot_length\":[784,1336,825,1336],\"head_point_up\":[834,390]},\"scale_bag\":0.7,\"scale_earrings\":0.16,\"self_template\":false,\"single_overall\":\"overall\",\"switch_category\":\"\"},\"items\":[{\"color\":\"204 182 182\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/blouse/0902002193.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Blouse\",\"image_id\":53557},{\"color\":\"49 127 162\",\"icon\":\"none\",\"path\":\"https://www.aida.com.hk/download/sys/images/skirt/0902000567.jpg\",\"print\":{\"print_path_list\":\"none\",\"IfSingle\":false},\"type\":\"Skirt\",\"image_id\":53562},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/hairstyle/hairstyle_p2357.jpg\",\"type\":\"Hairstyle\",\"image_id\":726},{\"color\":\"137 50 50\",\"path\":\"https://www.aida.com.hk/download/sys/accessories/shoes/shoes_6.jpg\",\"type\":\"Shoes\",\"image_id\":163},{\"path\":\"https://www.aida.com.hk/download/sys/accessories/earring/earrings_15.png\",\"type\":\"Earring\",\"image_id\":96},{\"body_path\":\"model_1693218345.2714431.png\",\"type\":\"Body\",\"image_id\":0}]}]}"; log.info("design请求python 参数:####{}", param); RequestBody body = RequestBody.create(mediaType, param); Request request = new Request.Builder() diff --git a/src/main/java/com/ai/da/service/GenerateService.java b/src/main/java/com/ai/da/service/GenerateService.java index 454f5df8..dd312874 100644 --- a/src/main/java/com/ai/da/service/GenerateService.java +++ b/src/main/java/com/ai/da/service/GenerateService.java @@ -1,12 +1,15 @@ package com.ai.da.service; +import com.ai.da.mapper.entity.Design; +import com.ai.da.mapper.entity.Generate; import com.ai.da.model.dto.GenerateLikeDTO; import com.ai.da.model.dto.GenerateThroughImageTextDTO; import com.ai.da.model.vo.GenerateCaptionVO; import com.ai.da.model.vo.GenerateCollectionVO; import com.ai.da.model.vo.GenerateLikeVO; +import com.baomidou.mybatisplus.extension.service.IService; -public interface GenerateService { +public interface GenerateService extends IService { GenerateCaptionVO generateCaption(Long sketchElementId); diff --git a/src/main/java/com/ai/da/service/WorkspaceService.java b/src/main/java/com/ai/da/service/WorkspaceService.java index c7ad9729..3ca2ff36 100644 --- a/src/main/java/com/ai/da/service/WorkspaceService.java +++ b/src/main/java/com/ai/da/service/WorkspaceService.java @@ -4,6 +4,7 @@ package com.ai.da.service; import com.ai.da.mapper.entity.Workspace; import com.ai.da.model.dto.WorkspaceDTO; import com.ai.da.model.enums.BizJson; +import com.ai.da.model.vo.ModelsVO; import com.ai.da.model.vo.WorkspaceVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; @@ -35,4 +36,6 @@ public interface WorkspaceService extends IService { List getEnumValues(String enumName); Workspace getByIdNew(Long id); + + List getMannequins(); } diff --git a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java index 4fff2496..b14a254f 100644 --- a/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/CollectionElementServiceImpl.java @@ -64,6 +64,8 @@ public class CollectionElementServiceImpl extends ServiceImpl usedElementIds = elementVO.getUsedElementIds(); List libraryCollectionElements = elementVO.getLibraryCollectionElements(); + List generateCollectionElements = elementVO.getGenerateCollectionElements(); //校验moodboard if (CollectionUtil.isNotEmpty(designDTO.getMoodBoards())) { //校验designType @@ -258,6 +261,17 @@ public class CollectionElementServiceImpl extends ServiceImpl generateIds = designDTO.getMoodBoards().stream() + .filter(o -> o.getDesignType().equals((DesignTypeEnum.GENERATE.getRealName()))) + .map(DesignCollectionElementDTO::getId) + .collect((Collectors.toList())); + if(CollectionUtil.isNotEmpty(generateIds)) { + List generateList = generateService.listByIds(generateIds); + if(CollectionUtil.isNotEmpty(generateList)){ + generateCollectionElements.addAll(covertGeneratesToCollections(generateList,null)); + } + } } if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) { //校验designType @@ -289,6 +303,20 @@ public class CollectionElementServiceImpl extends ServiceImpl generateIds = designDTO.getPrintBoards().stream() + .filter(o -> o.getDesignType().equals((DesignTypeEnum.GENERATE.getRealName()))) + .map(DesignCollectionPrintElementDTO::getId) + .collect((Collectors.toList())); + if(CollectionUtil.isNotEmpty(generateIds)) { + List generateList = generateService.listByIds(generateIds); + if(CollectionUtil.isNotEmpty(generateList)){ + Map idToMap = designDTO.getPrintBoards() + .stream() + .collect(Collectors.toMap(DesignCollectionPrintElementDTO::getId,v ->v)); + generateCollectionElements.addAll(covertGeneratesToPrintCollections(generateList,idToMap)); + } + } } if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) { //校验PIN是否满足 上衣或者下衣必须不超过8 @@ -335,6 +363,20 @@ public class CollectionElementServiceImpl extends ServiceImpl generateIds = designDTO.getSketchBoards().stream() + .filter(o -> o.getDesignType().equals((DesignTypeEnum.GENERATE.getRealName()))) + .map(CollectionSketchDTO::getSketchBoardId) + .collect((Collectors.toList())); + if(CollectionUtil.isNotEmpty(generateIds)) { + List generateList = generateService.listByIds(generateIds); + if(CollectionUtil.isNotEmpty(generateList)){ + Map idToMap = designDTO.getSketchBoards() + .stream() + .collect(Collectors.toMap(CollectionSketchDTO::getSketchBoardId,v ->v)); + generateCollectionElements.addAll(covertGeneratesToCollections(generateList,idToMap)); + } + } } //校验marketingSketch // 2023.12版本去掉了这个入参 @@ -411,11 +453,30 @@ public class CollectionElementServiceImpl extends ServiceImpl covertGeneratesToCollections(List generates, Map idToMap){ + return CopyUtil.copyList(generates,CollectionElement.class,(o,d) ->{ + if(null != idToMap){ + CollectionSketchDTO sketchDTO = idToMap.get(o.getId()); + d.setLevel2Type(sketchDTO.getLevel2Type()); + d.setHasPin(sketchDTO.getIsPin()); + } + }); + } + private List covertLibrarysToPrintCollections(List libraries, Map idToMap){ return CopyUtil.copyList(libraries,CollectionElement.class,(o,d) ->{ if(null != idToMap){ - DesignCollectionPrintElementDTO sketchDTO = idToMap.get(o.getId()); - d.setHasPin(sketchDTO.getIsPin()); + DesignCollectionPrintElementDTO printDTO = idToMap.get(o.getId()); + d.setHasPin(printDTO.getIsPin()); + } + }); + } + + private List covertGeneratesToPrintCollections(List generates, Map idToMap){ + return CopyUtil.copyList(generates,CollectionElement.class,(o,d) ->{ + if(null != idToMap){ + DesignCollectionPrintElementDTO printDTO = idToMap.get(o.getId()); + d.setHasPin(printDTO.getIsPin()); } }); } diff --git a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java index 7305f4d8..5c3ee07c 100644 --- a/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignItemServiceImpl.java @@ -69,7 +69,7 @@ public class DesignItemServiceImpl extends ServiceImpl impleme private PythonTAllInfoService pythonTAllInfoService; @Value("${minio.endpoint}") private String endpoint; - @Value("${minio.bucketName}") + @Value("${minio.bucketName.results}") private String bucketName; -// @Transactional + // @Transactional @Override public DesignCollectionVO designCollection(DesignCollectionDTO designDTO) { AuthPrincipalVo userInfo = UserContext.getUserHolder(); //校验collection element - ValidateElementVO elementVO =collectionElementService.validateElement(designDTO); + ValidateElementVO elementVO = collectionElementService.validateElement(designDTO); //design - return designOrRedesignOperateNew(designDTO,userInfo,null,elementVO); + return designOrRedesignOperateNew(designDTO, userInfo, null, elementVO); } - private void calculateLibraryAndSysFile(DesignCollectionDTO designDTO,ValidateElementVO elementVO,AuthPrincipalVo userInfo){ + + private void calculateLibraryAndSysFile(DesignCollectionDTO designDTO, ValidateElementVO elementVO, AuthPrincipalVo userInfo) { //查询用户 sketch library - List libraryVos ; - if(CollectionUtil.isNotEmpty(designDTO.getSketchBoards())){ + List libraryVos; + if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) { List sketchUrlList = elementVO.getSketchBoardElements() .stream() .map(CollectionElement::getUrl) .collect(Collectors.toList()); DesignAttributeRetrievalDTO designAttributeRetrievalDTO = - pythonService.generateAttributeRetrieval(sketchUrlList,userInfo.getId()); - if(CollectionUtils.isEmpty(designAttributeRetrievalDTO.getLibraryUrls())){ + pythonService.generateAttributeRetrieval(sketchUrlList, userInfo.getId()); + if (CollectionUtils.isEmpty(designAttributeRetrievalDTO.getLibraryUrls())) { libraryVos = null; - }else{ - libraryVos =libraryService.getByUrlList(designAttributeRetrievalDTO.getLibraryUrls(),userInfo.getId()); + } else { + libraryVos = libraryService.getByUrlList(designAttributeRetrievalDTO.getLibraryUrls(), userInfo.getId()); } - List sysFileVOS =sysFileService.getByUrlList(designAttributeRetrievalDTO.getSysFileUrlS()); + List sysFileVOS = sysFileService.getByUrlList(designAttributeRetrievalDTO.getSysFileUrlS()); elementVO.setSysFileVo(sysFileVOS); - }else{ - libraryVos =libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), + } else { + libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), Collections.singletonList(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())); } elementVO.setLibraryVos(libraryVos); //校验比列 - validateRatio(designDTO,libraryVos); + validateRatio(designDTO, libraryVos); } - private void validateRatio(DesignCollectionDTO designDTO, List libraryVos){ + + private void validateRatio(DesignCollectionDTO designDTO, List libraryVos) { //校验系统比列,先去掉 考虑到程序已经进入比较后面了,该校验不重要,且会产生脏数据 // BigDecimal bigDecimal = designDTO.getSystemScale(); // //池子是包括三部分 = 本次用户上传的sketch + library的sketch +系统的sketch,systemScale计算的是 library和sysFile的比列 @@ -130,127 +133,179 @@ public class DesignServiceImpl extends ServiceImpl impleme // throw new BusinessException("No sketch, please increase the system rate"); // } } - private void saveCollectionElemntsByLibrarys(ValidateElementVO elementVO,Long collectionId){ - if(CollectionUtils.isEmpty(elementVO.getLibraryCollectionElements())){ + + private void saveCollectionElemntsByLibrarys(ValidateElementVO elementVO, Long collectionId) { + if (CollectionUtils.isEmpty(elementVO.getLibraryCollectionElements())) { return; } elementVO.getLibraryCollectionElements() - .forEach(element ->{ + .forEach(element -> { element.setCollectionId(collectionId); Byte hasPin = element.getHasPin(); - if(Objects.isNull(hasPin)){ + if (Objects.isNull(hasPin)) { element.setHasPin((byte) 0); } element.setId(null); +// element.setType(DesignTypeEnum.LIBRARY.getRealName()); }); List saveElements = elementVO.getLibraryCollectionElements(); collectionElementService.saveBatch(saveElements); elementVO.getUsedElementIds().addAll(saveElements.stream().map(CollectionElement::getId).collect(Collectors.toList())); //sketch - List newSketchAboard =saveElements.stream() - .filter(f->f.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())) + List newSketchAboard = saveElements.stream() + .filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())) .collect(Collectors.toList()); - if(!CollectionUtils.isEmpty(newSketchAboard)){ + if (!CollectionUtils.isEmpty(newSketchAboard)) { elementVO.getSketchBoardElements().addAll(newSketchAboard); } //print - List newPrintboard =saveElements.stream() - .filter(f->f.getLevel1Type().equals(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName())) + List newPrintboard = saveElements.stream() + .filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName())) .collect(Collectors.toList()); - if(!CollectionUtils.isEmpty(newPrintboard)){ + if (!CollectionUtils.isEmpty(newPrintboard)) { elementVO.getPrintBoardElements().addAll(newPrintboard); } - } - private DesignCollectionVO designOrRedesignOperate(DesignCollectionDTO designDTO,AuthPrincipalVo userInfo, - Long collectionIdParam,ValidateElementVO elementVO){ - if(CollectionUtil.isNotEmpty(designDTO.getSketchBoards())){ - //编辑sketchBoard - collectionElementService.editSketchBoardsElement(elementVO,designDTO.getSketchBoards()); + //mood + List newMoodboard = saveElements.stream() + .filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.MOOD_BOARD.getRealName())) + .collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(newMoodboard)) { + elementVO.getMoodBoardElements().addAll(newMoodboard); } - if(CollectionUtil.isNotEmpty(designDTO.getPrintBoards())){ + } + + private void saveCollectionElemntsByGenerates(ValidateElementVO elementVO, Long collectionId) { + if (CollectionUtils.isEmpty(elementVO.getGenerateCollectionElements())) { + return; + } + elementVO.getGenerateCollectionElements() + .forEach(element -> { + element.setCollectionId(collectionId); + Byte hasPin = element.getHasPin(); + if (Objects.isNull(hasPin)) { + element.setHasPin((byte) 0); + } + element.setId(null); +// element.setType(DesignTypeEnum.GENERATE.getRealName()); + }); + List saveElements = elementVO.getGenerateCollectionElements(); + collectionElementService.saveBatch(saveElements); + elementVO.getUsedElementIds().addAll(saveElements.stream().map(CollectionElement::getId).collect(Collectors.toList())); + //sketch + List newSketchAboard = saveElements.stream() + .filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())) + .collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(newSketchAboard)) { + elementVO.getSketchBoardElements().addAll(newSketchAboard); + } + //print + List newPrintboard = saveElements.stream() + .filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName())) + .collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(newPrintboard)) { + elementVO.getPrintBoardElements().addAll(newPrintboard); + } + //mood + List newMoodboard = saveElements.stream() + .filter(f -> f.getLevel1Type().equals(CollectionLevel1TypeEnum.MOOD_BOARD.getRealName())) + .collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(newMoodboard)) { + elementVO.getMoodBoardElements().addAll(newMoodboard); + } + } + + private DesignCollectionVO designOrRedesignOperate(DesignCollectionDTO designDTO, AuthPrincipalVo userInfo, + Long collectionIdParam, ValidateElementVO elementVO) { + if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) { + //编辑sketchBoard + collectionElementService.editSketchBoardsElement(elementVO, designDTO.getSketchBoards()); + } + if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) { //编辑printBoard - collectionElementService.editPrintBoardsElement(elementVO,designDTO.getPrintBoards()); + collectionElementService.editPrintBoardsElement(elementVO, designDTO.getPrintBoards()); } //保存collection Long collectionId = (null == collectionIdParam) ? - collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam; + collectionService.saveCollection(userInfo.getId(), designDTO.getTimeZone(), designDTO.getMoodTemplateId()) : collectionIdParam; List elementIds = getElementId(elementVO); //批量关联element 到 collection - collectionElementService.relationCollection(elementIds,collectionId); + collectionElementService.relationCollection(elementIds, collectionId); //library转化为collection(生成) - saveCollectionElemntsByLibrarys(elementVO,collectionId); + saveCollectionElemntsByLibrarys(elementVO, collectionId); //保存颜色版 - List colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(),collectionId,designDTO.getTimeZone()); + List colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone()); //保存design - Long designId = saveOne(designDTO,collectionId,userInfo.getId()); + Long designId = saveOne(designDTO, collectionId, userInfo.getId()); //计算library - calculateLibraryAndSysFile(designDTO,elementVO,userInfo); + calculateLibraryAndSysFile(designDTO, elementVO, userInfo); //组装design入参 DesignPythonObjects pythonObjects = pythonService.covertDesignParam(designDTO.getSystemScale(), - designDTO.getSingleOverall(),designDTO.getSwitchCategory(),elementVO); + designDTO.getSingleOverall(), designDTO.getSwitchCategory(), elementVO); //缓存保存的文件 方便后面处理进度问题 - setDesignProcess(userInfo.getId(),pythonObjects); + setDesignProcess(userInfo.getId(), pythonObjects); //design pythonService.design(pythonObjects); //生成library - generateLibrary(elementVO,designDTO.getTimeZone()); + generateLibrary(elementVO, designDTO.getTimeZone()); //处理关联关系,修复element覆盖得情况 - List reLationelements =collectionElementService.getByOnlyCollectionId(collectionId); - List reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList()); - handleCollectionElementRelation(collectionId,(null == collectionIdParam) ? false :true,reLationelementIds); + List reLationelements = collectionElementService.getByOnlyCollectionId(collectionId); + List reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList()); + handleCollectionElementRelation(collectionId, (null == collectionIdParam) ? false : true, reLationelementIds); //保存python返回信息 // return savePythonDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone(),responseJSONObject); //保存designItem 和detail - return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone()); + return saveDesignItemAndDetail(pythonObjects, designId, collectionId, userInfo, designDTO.getTimeZone()); } - private DesignCollectionVO designOrRedesignOperateNew(DesignCollectionDTO designDTO,AuthPrincipalVo userInfo, - Long collectionIdParam,ValidateElementVO elementVO){ - if(CollectionUtil.isNotEmpty(designDTO.getSketchBoards())){ + private DesignCollectionVO designOrRedesignOperateNew(DesignCollectionDTO designDTO, AuthPrincipalVo userInfo, + Long collectionIdParam, ValidateElementVO elementVO) { + if (CollectionUtil.isNotEmpty(designDTO.getSketchBoards())) { //编辑sketchBoard - collectionElementService.editSketchBoardsElement(elementVO,designDTO.getSketchBoards()); + collectionElementService.editSketchBoardsElement(elementVO, designDTO.getSketchBoards()); } - if(CollectionUtil.isNotEmpty(designDTO.getPrintBoards())){ + if (CollectionUtil.isNotEmpty(designDTO.getPrintBoards())) { //编辑printBoard - collectionElementService.editPrintBoardsElement(elementVO,designDTO.getPrintBoards()); + collectionElementService.editPrintBoardsElement(elementVO, designDTO.getPrintBoards()); } //保存collection Long collectionId = (null == collectionIdParam) ? - collectionService.saveCollection(userInfo.getId(),designDTO.getTimeZone(),designDTO.getMoodTemplateId()) : collectionIdParam; + collectionService.saveCollection(userInfo.getId(), designDTO.getTimeZone(), designDTO.getMoodTemplateId()) : collectionIdParam; List elementIds = getElementId(elementVO); //批量关联element 到 collection - collectionElementService.relationCollection(elementIds,collectionId); + collectionElementService.relationCollection(elementIds, collectionId); //library转化为collection(生成) - saveCollectionElemntsByLibrarys(elementVO,collectionId); + saveCollectionElemntsByLibrarys(elementVO, collectionId); + //generate转化为collection(生成) + saveCollectionElemntsByGenerates(elementVO, collectionId); //保存颜色版 - List colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(),collectionId,designDTO.getTimeZone()); + List colorElementList = collectionElementService.saveColorBoard(designDTO.getColorBoards(), collectionId, designDTO.getTimeZone()); //保存design - Long designId = saveOne(designDTO,collectionId,userInfo.getId()); + Long designId = saveOne(designDTO, collectionId, userInfo.getId()); //计算library - calculateLibraryAndSysFile(designDTO,elementVO,userInfo); + calculateLibraryAndSysFile(designDTO, elementVO, userInfo); //组装design入参 DesignPythonObjects pythonObjects = pythonService.covertDesignParam(designDTO.getSystemScale(), - designDTO.getSingleOverall(),designDTO.getSwitchCategory(),elementVO); + designDTO.getSingleOverall(), designDTO.getSwitchCategory(), elementVO); //缓存保存的文件 方便后面处理进度问题 - setDesignProcess(userInfo.getId(),pythonObjects); + setDesignProcess(userInfo.getId(), pythonObjects); // pythonObjects增加image_id关联 relationImageId(pythonObjects); //design JSONObject responseJSONObject = pythonService.designNew(pythonObjects); //生成library - generateLibrary(elementVO,designDTO.getTimeZone()); + generateLibrary(elementVO, designDTO.getTimeZone()); //处理关联关系,修复element覆盖得情况 - List reLationelements =collectionElementService.getByOnlyCollectionId(collectionId); - List reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList()); - handleCollectionElementRelation(collectionId,(null == collectionIdParam) ? false :true,reLationelementIds); + List reLationelements = collectionElementService.getByOnlyCollectionId(collectionId); + List reLationelementIds = reLationelements.stream().map(CollectionElement::getId).collect(Collectors.toList()); + handleCollectionElementRelation(collectionId, (null == collectionIdParam) ? false : true, reLationelementIds); //保存python返回信息 - return savePythonDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone(),responseJSONObject); + return savePythonDesignItemAndDetail(pythonObjects, designId, collectionId, userInfo, designDTO.getTimeZone(), responseJSONObject); //保存designItem 和detail // return saveDesignItemAndDetail(pythonObjects,designId,collectionId,userInfo,designDTO.getTimeZone()); } private void relationImageId(DesignPythonObjects pythonObjects) { - if(Objects.isNull(pythonObjects)) { + if (Objects.isNull(pythonObjects)) { return; } pythonObjects.getObjects().forEach( @@ -260,58 +315,60 @@ public class DesignServiceImpl extends ServiceImpl impleme if (StringUtils.isEmpty(path)) { String bodyPath = item.getBody_path(); Long imageId = pythonTAllInfoService.getImageIdByPath(bodyPath); - item.setImageId(imageId); - }else { + item.setImage_id(imageId); + } else { Long imageId = pythonTAllInfoService.getImageIdByPath(path); - item.setImageId(imageId); + item.setImage_id(imageId); } } } ); } - private void handleCollectionElementRelation(Long collectionId ,Boolean isEdit,List elementIds ){ - if (CollectionUtils.isEmpty(elementIds) || collectionId == null){ + private void handleCollectionElementRelation(Long collectionId, Boolean isEdit, List elementIds) { + if (CollectionUtils.isEmpty(elementIds) || collectionId == null) { return; } - if(isEdit){ + if (isEdit) { //删除 tCollectionElementRelationService.deleteByCollectionId(collectionId); } //新增 tCollectionElementRelationService.saveBatch(elementIds.stream().map(elementId -> - TCollectionElementRelation.builder() - .collectionId(collectionId) - .elementId(elementId) - .createDate(new Date()) - .build() + TCollectionElementRelation.builder() + .collectionId(collectionId) + .elementId(elementId) + .createDate(new Date()) + .build() ).collect(Collectors.toList())); } - private void generateLibrary(ValidateElementVO elementVO,String timeZone){ + + private void generateLibrary(ValidateElementVO elementVO, String timeZone) { List elements = Lists.newArrayList(); - if(!CollectionUtils.isEmpty(elementVO.getMoodBoardElements())){ + if (!CollectionUtils.isEmpty(elementVO.getMoodBoardElements())) { elements.addAll(elementVO.getMoodBoardElements()); } - if(!CollectionUtils.isEmpty(elementVO.getPrintBoardElements())){ + if (!CollectionUtils.isEmpty(elementVO.getPrintBoardElements())) { elements.addAll(elementVO.getPrintBoardElements()); } - if(!CollectionUtils.isEmpty(elementVO.getSketchBoardElements())){ + if (!CollectionUtils.isEmpty(elementVO.getSketchBoardElements())) { elements.addAll(elementVO.getSketchBoardElements()); } - if(!CollectionUtils.isEmpty(elementVO.getMarketingSketchElements())){ + if (!CollectionUtils.isEmpty(elementVO.getMarketingSketchElements())) { elements.addAll(elementVO.getMarketingSketchElements()); } - collectionElementService.saveLibraryByCollectionElement(elements,timeZone); + collectionElementService.saveLibraryByCollectionElement(elements, timeZone); } + @Override - public BigDecimal countDesignProcess(){ + public BigDecimal countDesignProcess() { AuthPrincipalVo userInfo = UserContext.getUserHolder(); List saveNames = LocalCacheUtils.getDesignProcessCache(userInfo.getId()); - if (CollectionUtils.isEmpty(saveNames)){ + if (CollectionUtils.isEmpty(saveNames)) { return BigDecimal.ZERO; } - int totalProcess =0; - log.info("design 统计进度###totalProcess1{}",totalProcess); + int totalProcess = 0; + log.info("design 统计进度###totalProcess1{}", totalProcess); //转成本地文件先 for (String saveName : saveNames) { String localFileUrl = saveName; @@ -319,32 +376,34 @@ public class DesignServiceImpl extends ServiceImpl impleme if (!StringUtils.isEmpty(linuxDomain)) { //linux 系统 String oldPath = fileProperties.getSys().getPath(); - localFileUrl = saveName.replace(linuxDomain,oldPath); + localFileUrl = saveName.replace(linuxDomain, oldPath); } File file = new File(localFileUrl); - if(file.exists()){ + if (file.exists()) { totalProcess++; - log.info("design 统计进度++###totalProcess+++{}",totalProcess); + log.info("design 统计进度++###totalProcess+++{}", totalProcess); } } - log.info("design 统计进度###totalProcess2{}",totalProcess); - BigDecimal result = BigDecimal.valueOf(totalProcess).divide(BigDecimal.valueOf(8)).setScale(3,BigDecimal.ROUND_HALF_UP); - if (result.compareTo(BigDecimal.ONE) == 0){ + log.info("design 统计进度###totalProcess2{}", totalProcess); + BigDecimal result = BigDecimal.valueOf(totalProcess).divide(BigDecimal.valueOf(8)).setScale(3, BigDecimal.ROUND_HALF_UP); + if (result.compareTo(BigDecimal.ONE) == 0) { LocalCacheUtils.delDesignProcessCache(userInfo.getId()); } return result; } - private void setDesignProcess(Long userId,DesignPythonObjects pythonObjects){ - List saveNames = pythonObjects.getObjects().stream().map(object ->{ - return object.getBasic().getSave_name();}).collect(Collectors.toList()); - LocalCacheUtils.setDesignProcessCache(userId,saveNames); + private void setDesignProcess(Long userId, DesignPythonObjects pythonObjects) { + List saveNames = pythonObjects.getObjects().stream().map(object -> { + return object.getBasic().getSave_name(); + }).collect(Collectors.toList()); + LocalCacheUtils.setDesignProcessCache(userId, saveNames); } @Resource private MinioUtil minIoUtil; + private DesignCollectionVO savePythonDesignItemAndDetail(DesignPythonObjects pythonObjects - ,Long designId,Long collectionId,AuthPrincipalVo userInfo,String timeZone, JSONObject responseJSONObject){ + , Long designId, Long collectionId, AuthPrincipalVo userInfo, String timeZone, JSONObject responseJSONObject) { DesignCollectionVO response = new DesignCollectionVO(); response.setDesignId(designId); response.setCollectionId(collectionId); @@ -363,7 +422,7 @@ public class DesignServiceImpl extends ServiceImpl impleme designItem.setCreateDate(DateUtil.getByTimeZone(timeZone)); //生成的八张图片 designItem.setDesignUrl(item.getBasic().getSave_name()); - designItem.setHasLike((byte)0); + designItem.setHasLike((byte) 0); //生成designItem Long designItemId = designItemService.saveOne(designItem); // python design返回入库及封装 @@ -391,7 +450,7 @@ public class DesignServiceImpl extends ServiceImpl impleme for (int i2 = 0; i2 < position.size(); i2++) { if (i2 != position.size() - 1) { builder.append(position.getInteger(i2)).append(","); - }else { + } else { builder.append(position.getInteger(i2)); } } @@ -403,7 +462,7 @@ public class DesignServiceImpl extends ServiceImpl impleme for (int i2 = 0; i2 < imageSize.size(); i2++) { if (i2 != imageSize.size() - 1) { builder.append(imageSize.getInteger(i2)).append(","); - }else { + } else { builder.append(imageSize.getInteger(i2)); } } @@ -420,29 +479,33 @@ public class DesignServiceImpl extends ServiceImpl impleme designCollectionItemVO.setDesignItemId(designItemId); designCollectionItemVO.setDesignItemUrl(designItem.getDesignUrl()); designCollectionItemVO.setDesignOutfitId(designPythonOutfit.getId()); - designCollectionItemVO.setDesignOutfitUrl(minIoUtil.getPresignedUrl(bucketName, designPythonOutfit.getDesignUrl(), 5)); + String designUrl = designPythonOutfit.getDesignUrl(); + if (!StringUtils.isEmpty(designUrl) && designUrl.contains("/")) { + int firstIndex = designUrl.indexOf("/"); + designCollectionItemVO.setDesignOutfitUrl(minIoUtil.getPresignedUrl(designUrl.substring(0,firstIndex), designUrl.substring(firstIndex+1), 5)); + } //response designCollectionItems.add(designCollectionItemVO); List designItemDetails = Lists.newArrayList(); - item.getItems().forEach(detail ->{ - if(null == detail){ + item.getItems().forEach(detail -> { + if (null == detail) { return; } - DesignItemDetail designItemDetail = CopyUtil.copyObject(detail,DesignItemDetail.class); + DesignItemDetail designItemDetail = CopyUtil.copyObject(detail, DesignItemDetail.class); designItemDetail.setAccountId(userInfo.getId()); designItemDetail.setDesignId(designId); designItemDetail.setDesignItemId(designItemId); designItemDetail.setCollectionElementId(detail.getElementId()); designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone)); - if(SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())){ + if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) { designItemDetail.setPath(detail.getBody_path()); //BODY不关联businessId designItemDetail.setBusinessId(0L); } designItemDetail.setIconPath(detail.getIcon()); DesignPythonItemPrint printObject = detail.getPrint(); - designItemDetail.setPrintPath(Objects.isNull(printObject)? "" :printObject.getPath()); + designItemDetail.setPrintPath(Objects.isNull(printObject) ? "" : printObject.getPath()); designItemDetails.add(designItemDetail); }); designItemDetailService.saveBatch(designItemDetails); @@ -452,14 +515,14 @@ public class DesignServiceImpl extends ServiceImpl impleme } private DesignCollectionVO saveDesignItemAndDetail(DesignPythonObjects pythonObjects - ,Long designId,Long collectionId,AuthPrincipalVo userInfo,String timeZone){ + , Long designId, Long collectionId, AuthPrincipalVo userInfo, String timeZone) { DesignCollectionVO response = new DesignCollectionVO(); response.setDesignId(designId); response.setCollectionId(collectionId); List designCollectionItems = Lists.newArrayList(); response.setDesignCollectionItems(designCollectionItems); - pythonObjects.getObjects().forEach(item ->{ + pythonObjects.getObjects().forEach(item -> { DesignItem designItem = new DesignItem(); designItem.setAccountId(userInfo.getId()); designItem.setCollectionId(collectionId); @@ -467,47 +530,48 @@ public class DesignServiceImpl extends ServiceImpl impleme designItem.setCreateDate(DateUtil.getByTimeZone(timeZone)); //生成的八张图片 designItem.setDesignUrl(item.getBasic().getSave_name()); - designItem.setHasLike((byte)0); + designItem.setHasLike((byte) 0); //生成designItem Long designItemId = designItemService.saveOne(designItem); //response - designCollectionItems.add(new DesignCollectionItemVO(designItemId,designItem.getDesignUrl(), null, null)); + designCollectionItems.add(new DesignCollectionItemVO(designItemId, designItem.getDesignUrl(), null, null)); List designItemDetails = Lists.newArrayList(); - item.getItems().forEach(detail ->{ - if(null == detail){ + item.getItems().forEach(detail -> { + if (null == detail) { return; } - DesignItemDetail designItemDetail = CopyUtil.copyObject(detail,DesignItemDetail.class); + DesignItemDetail designItemDetail = CopyUtil.copyObject(detail, DesignItemDetail.class); designItemDetail.setAccountId(userInfo.getId()); designItemDetail.setDesignId(designId); designItemDetail.setDesignItemId(designItemId); designItemDetail.setCollectionElementId(detail.getElementId()); designItemDetail.setCreateDate(DateUtil.getByTimeZone(timeZone)); - if(SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())){ + if (SysFileLevel2TypeEnum.BODY.getRealName().equals(detail.getType())) { designItemDetail.setPath(detail.getBody_path()); //BODY不关联businessId designItemDetail.setBusinessId(0L); } designItemDetail.setIconPath(detail.getIcon()); DesignPythonItemPrint printObject = detail.getPrint(); - designItemDetail.setPrintPath(Objects.isNull(printObject)? "" :printObject.getPath()); + designItemDetail.setPrintPath(Objects.isNull(printObject) ? "" : printObject.getPath()); designItemDetails.add(designItemDetail); }); designItemDetailService.saveBatch(designItemDetails); }); return response; } - private List getElementId(ValidateElementVO elementVO){ + + private List getElementId(ValidateElementVO elementVO) { List elementIds = Lists.newArrayList(); // collection type - if(CollectionUtil.isNotEmpty(elementVO.getSketchBoardElements())){ + if (CollectionUtil.isNotEmpty(elementVO.getSketchBoardElements())) { elementIds.addAll(elementVO.getSketchBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList())); } - if(CollectionUtil.isNotEmpty(elementVO.getMoodBoardElements())){ + if (CollectionUtil.isNotEmpty(elementVO.getMoodBoardElements())) { elementIds.addAll(elementVO.getMoodBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList())); } - if(CollectionUtil.isNotEmpty(elementVO.getPrintBoardElements())){ + if (CollectionUtil.isNotEmpty(elementVO.getPrintBoardElements())) { elementIds.addAll(elementVO.getPrintBoardElements().stream().map(CollectionElement::getId).collect(Collectors.toList())); } // if(CollectionUtil.isNotEmpty(elementVO.getMarketingSketchElements())){ @@ -520,18 +584,18 @@ public class DesignServiceImpl extends ServiceImpl impleme public DesignCollectionVO reDesignCollection(ReDesignCollectionDTO reDesignDTO) { //校验collection Collection collection = collectionService.findById(reDesignDTO.getCollectionId()); - Assert.notNull(collection,"Collection does not exist!"); + Assert.notNull(collection, "Collection does not exist!"); AuthPrincipalVo userInfo = UserContext.getUserHolder(); //查询用户 sketch library - List libraryVos =libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), + List libraryVos = libraryService.selectByAccountIdAnd1TypeList(userInfo.getId(), Arrays.asList(CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(), CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName())); //校验collection element - ValidateElementVO elementVO =collectionElementService.validateElement( - CopyUtil.copyObject(reDesignDTO,DesignCollectionDTO.class)); + ValidateElementVO elementVO = collectionElementService.validateElement( + CopyUtil.copyObject(reDesignDTO, DesignCollectionDTO.class)); //计算并删除对应的未关联的element collectionElementService.batchDelete( - calculateNoRelationElement(reDesignDTO.getCollectionId(),elementVO.getUsedElementIds())); + calculateNoRelationElement(reDesignDTO.getCollectionId(), elementVO.getUsedElementIds())); Design oldDesign = selectByCollectionId(reDesignDTO.getCollectionId()); //删除老的关联的design deleteByCollectionId(reDesignDTO.getCollectionId()); @@ -539,18 +603,19 @@ public class DesignServiceImpl extends ServiceImpl impleme designItemDetailService.deleteByDesignId(oldDesign.getId()); //redesign return designOrRedesignOperate(CopyUtil.copyObject( - reDesignDTO,DesignCollectionDTO.class),userInfo,reDesignDTO.getCollectionId(),elementVO); + reDesignDTO, DesignCollectionDTO.class), userInfo, reDesignDTO.getCollectionId(), elementVO); } - private List calculateNoRelationElement(Long collectionId ,List usedElementIds){ + + private List calculateNoRelationElement(Long collectionId, List usedElementIds) { List collectionElements = collectionElementService.getByCollectionId(collectionId); - if(CollectionUtils.isEmpty(collectionElements)){ + if (CollectionUtils.isEmpty(collectionElements)) { throw new BusinessException("get collection elements cannot be empty"); } - if(CollectionUtils.isEmpty(usedElementIds)){ + if (CollectionUtils.isEmpty(usedElementIds)) { return collectionElements.stream().map(CollectionElement::getId).collect(Collectors.toList()); } return collectionElements.stream() - .filter(filter ->!usedElementIds.contains(filter.getId())) + .filter(filter -> !usedElementIds.contains(filter.getId())) .map(CollectionElement::getId) .collect(Collectors.toList()); } @@ -558,17 +623,18 @@ public class DesignServiceImpl extends ServiceImpl impleme @Override public DesignCollectionVO designItemList(Long designId) { Design design = getById(designId); - Assert.notNull(design,"design does not exist!"); + Assert.notNull(design, "design does not exist!"); List designItems = designItemService.getByDesignId(designId); - if(CollectionUtils.isEmpty(designItems)){ - return new DesignCollectionVO(designId,design.getCollectionId(),null); + if (CollectionUtils.isEmpty(designItems)) { + return new DesignCollectionVO(designId, design.getCollectionId(), null); } - return new DesignCollectionVO(designId,design.getCollectionId(),coverDesignItemToVO(designItems)); + return new DesignCollectionVO(designId, design.getCollectionId(), coverDesignItemToVO(designItems)); } - private List coverDesignItemToVO( List designItems){ + + private List coverDesignItemToVO(List designItems) { List response = Lists.newArrayList(); designItems.forEach(designItem -> { - response.add(new DesignCollectionItemVO(designItem.getId(),designItem.getDesignUrl(), null, null)); + response.add(new DesignCollectionItemVO(designItem.getId(), designItem.getDesignUrl(), null, null)); }); return response; } @@ -579,81 +645,83 @@ public class DesignServiceImpl extends ServiceImpl impleme Long groupDetailId = null; AuthPrincipalVo userInfo = UserContext.getUserHolder(); DesignItem designItem = designItemService.getById(designLikeDTO.getDesignItemId()); - Assert.notNull(designItem,"designItem does not exist!"); - if(Objects.nonNull(designLikeDTO.getUserGroupId())){ + Assert.notNull(designItem, "designItem does not exist!"); + if (Objects.nonNull(designLikeDTO.getUserGroupId())) { userGroupId = designLikeDTO.getUserGroupId(); UserLikeGroup userLikeGroup = userLikeGroupService.getById(designLikeDTO.getUserGroupId()); - Assert.notNull(userLikeGroup,"History does not exist!"); + Assert.notNull(userLikeGroup, "History does not exist!"); // if(designItem.getCollectionId().equals(userLikeGroup.getCollectionId())){ // //相同collection直接跳过 不需要往element加元素 // return new DesignLikeVO(); // } List oldElements = collectionElementService.getByCollectionId(userLikeGroup.getCollectionId()); - Assert.notEmpty(oldElements,"old elements does not exist!"); + Assert.notEmpty(oldElements, "old elements does not exist!"); List designItemDetails = designItemDetailService.selectByDesignItemId(designLikeDTO.getDesignItemId()); - Assert.notEmpty(designItemDetails,"new designItemDetails does not exist!"); + Assert.notEmpty(designItemDetails, "new designItemDetails does not exist!"); //判断老的element合并到新的是否满足 数量不超过15 - List newElementIds = validateMergeElement(oldElements,designItemDetails); + List newElementIds = validateMergeElement(oldElements, designItemDetails); //合并,关联新的element到collection - collectionElementService.relationCollection(newElementIds,userLikeGroup.getCollectionId()); + collectionElementService.relationCollection(newElementIds, userLikeGroup.getCollectionId()); //处理关联关系,修复element覆盖得情况 - handleCollectionElementRelation(userLikeGroup.getCollectionId(),false,newElementIds); + handleCollectionElementRelation(userLikeGroup.getCollectionId(), false, newElementIds); UserLike userLike = resolveUserLike(designLikeDTO.getUserGroupId(), designItem.getDesignId(), - designLikeDTO.getDesignItemId(),designItem.getDesignUrl(),designLikeDTO.getTimeZone()); + designLikeDTO.getDesignItemId(), designItem.getDesignUrl(), designLikeDTO.getTimeZone()); userLikeService.save(userLike); groupDetailId = userLike.getId(); - }else{ + } else { //第一次like - userGroupId = userLikeGroupService.insertUserGroup(userInfo.getId(),designItem.getCollectionId(),designLikeDTO.getTimeZone()); - UserLike userLike =resolveUserLike(userGroupId, - designItem.getDesignId(),designLikeDTO.getDesignItemId(),designItem.getDesignUrl(),designLikeDTO.getTimeZone()); + userGroupId = userLikeGroupService.insertUserGroup(userInfo.getId(), designItem.getCollectionId(), designLikeDTO.getTimeZone()); + UserLike userLike = resolveUserLike(userGroupId, + designItem.getDesignId(), designLikeDTO.getDesignItemId(), designItem.getDesignUrl(), designLikeDTO.getTimeZone()); userLikeService.save(userLike); groupDetailId = userLike.getId(); } //修改designItem为like状态 - designItemService.updateLikeStatus(designLikeDTO.getDesignItemId(),(byte)1); - return new DesignLikeVO(userGroupId,groupDetailId); + designItemService.updateLikeStatus(designLikeDTO.getDesignItemId(), (byte) 1); + return new DesignLikeVO(userGroupId, groupDetailId); } - private List validateMergeElement(List oldElements,List designItemDetails){ + private List validateMergeElement(List oldElements, List designItemDetails) { List hasCollections = designItemDetails.stream() - .filter(f->Objects.nonNull(f.getCollectionElementId())) + .filter(f -> Objects.nonNull(f.getCollectionElementId())) .collect(Collectors.toList()); - if(CollectionUtils.isEmpty(hasCollections)){ + if (CollectionUtils.isEmpty(hasCollections)) { return null; } List oldIds = oldElements.stream().map(CollectionElement::getId).collect(Collectors.toList()); List elementIds = hasCollections.stream().map(DesignItemDetail::getCollectionElementId).collect(Collectors.toList()); //本次新增collection个数 - List adds = elementIds.stream().filter(id ->!oldIds.contains(id)).collect(Collectors.toList()); - if(CollectionUtils.isEmpty(adds)){ + List adds = elementIds.stream().filter(id -> !oldIds.contains(id)).collect(Collectors.toList()); + if (CollectionUtils.isEmpty(adds)) { return null; } //校验15次 - Map> group = oldElements.stream() + Map> group = oldElements.stream() .collect(Collectors.groupingBy(CollectionElement::getLevel1Type)); - group.forEach((k,v) ->{ + group.forEach((k, v) -> { List thisElement = group.get(k); - int groupNum = calculateGroupNum(thisElement,adds); - if(groupNum >15){ - throw new BusinessException("The size of element type" +k+ "exceeds 15"); + int groupNum = calculateGroupNum(thisElement, adds); + if (groupNum > 15) { + throw new BusinessException("The size of element type" + k + "exceeds 15"); } }); return adds; } - private int calculateGroupNum(List thisElement,List adds){ + + private int calculateGroupNum(List thisElement, List adds) { int num = 0; List groupOldIds = thisElement.stream().map(CollectionElement::getId).collect(Collectors.toList()); for (Long add : adds) { - if(groupOldIds.contains(add)){ - num ++ ; + if (groupOldIds.contains(add)) { + num++; } } - return num +thisElement.size(); + return num + thisElement.size(); } - private UserLike resolveUserLike(Long userGroupId,Long designId,Long designItemId, String designUrl,String timeZone){ + + private UserLike resolveUserLike(Long userGroupId, Long designId, Long designItemId, String designUrl, String timeZone) { UserLike userLike = new UserLike(); userLike.setCreateDate(DateUtil.getByTimeZone(timeZone)); userLike.setDesignId(designId); @@ -667,21 +735,21 @@ public class DesignServiceImpl extends ServiceImpl impleme public Boolean dislike(DisDesignLikeDTO disDesignLikeDTO) { AuthPrincipalVo userInfo = UserContext.getUserHolder(); UserLike userLike = userLikeService.getById(disDesignLikeDTO.getGroupDetailId()); - Assert.notNull(userLike,"History detail does not exist!"); + Assert.notNull(userLike, "History detail does not exist!"); Design design = getById(disDesignLikeDTO.getDesignId()); - Assert.notNull(design,"design does not exist!"); - if(!userLike.getDesignId().equals(disDesignLikeDTO.getDesignId())){ + Assert.notNull(design, "design does not exist!"); + if (!userLike.getDesignId().equals(disDesignLikeDTO.getDesignId())) { //不是相同的design不会合并 return Boolean.TRUE; } //修改designItem为dislike状态 - designItemService.updateLikeStatus(userLike.getDesignItemId(),(byte)0); + designItemService.updateLikeStatus(userLike.getDesignItemId(), (byte) 0); //删除关联的collection,先不做 //删除对应的history userLikeService.removeById(disDesignLikeDTO.getGroupDetailId()); List userLikeVOS = userLikeService.getGroupDetail(userLike.getUserLikeGroupId()); - if(CollectionUtils.isEmpty(userLikeVOS)){ + if (CollectionUtils.isEmpty(userLikeVOS)) { //group 下面没有元素时候 直接删除 userLikeGroupService.removeById(userLike.getUserLikeGroupId()); } @@ -691,41 +759,41 @@ public class DesignServiceImpl extends ServiceImpl impleme @Override public String generateHighDesign(GenerateHighDesignDTO generateHighDesignDTO) { DesignItem designItem = designItemService.getById(generateHighDesignDTO.getDesignItemId()); - Assert.notNull(designItem,"design item does not exist!"); + Assert.notNull(designItem, "design item does not exist!"); String highUrl = pythonService.generateHighDesign(designItem.getDesignUrl()); //存储 - designItemService.updateDesignHighUrl(designItem.getId(),highUrl,generateHighDesignDTO.getTimeZone()); - return highUrl ; + designItemService.updateDesignHighUrl(designItem.getId(), highUrl, generateHighDesignDTO.getTimeZone()); + return highUrl; } @Override public Boolean deleteHighDesign(GenerateHighDesignDTO generateHighDesignDTO) { DesignItem designItem = designItemService.getById(generateHighDesignDTO.getDesignItemId()); - Assert.notNull(designItem,"design item does not exist!"); - if(StringUtils.isEmpty(designItem.getHighDesignUrl())){ + Assert.notNull(designItem, "design item does not exist!"); + if (StringUtils.isEmpty(designItem.getHighDesignUrl())) { //并发情况 ,不提示 直接返回 return Boolean.TRUE; } //存储 - designItemService.updateDesignHighUrl(designItem.getId(),"",generateHighDesignDTO.getTimeZone()); + designItemService.updateDesignHighUrl(designItem.getId(), "", generateHighDesignDTO.getTimeZone()); FileUtil.delete(designItem.getHighDesignUrl()); return Boolean.TRUE; } @Override - public DesignItemDetailVO detail(Long designPythonOutfitId,Long designItemId) { + public DesignItemDetailVO detail(Long designPythonOutfitId, Long designItemId) { DesignItem designItem = designItemService.getById(designItemId); - Assert.notNull(designItem,"design item does not exist!"); + Assert.notNull(designItem, "design item does not exist!"); Design design = getById(designItem.getDesignId()); - Assert.notNull(design,"design does not exist!"); + Assert.notNull(design, "design does not exist!"); List designItemDetails = designItemDetailService.selectByDesignItemId(designItemId); - Assert.notEmpty(designItemDetails,"designItemDetails does not exist!"); + Assert.notEmpty(designItemDetails, "designItemDetails does not exist!"); // 添加判断designPythonOutfitId是否存在 TDesignPythonOutfit designPythonOutfit = new TDesignPythonOutfit(); Boolean flag = Boolean.FALSE; - if (Objects.nonNull(designPythonOutfitId)){ + if (Objects.nonNull(designPythonOutfitId)) { designPythonOutfit = designPythonOutfitService.getById(designPythonOutfitId); - Assert.notNull(designPythonOutfit,"designPythonOutfit does not exist!"); + Assert.notNull(designPythonOutfit, "designPythonOutfit does not exist!"); flag = Boolean.TRUE; } @@ -738,37 +806,38 @@ public class DesignServiceImpl extends ServiceImpl impleme List filterDetail = designItemDetails.stream() .filter(f -> OUTWEAR_DRESS_BLOUSE.contains(f.getType()) || SKIRT_TROUSERS.contains(f.getType())) .collect(Collectors.toList()); - response.setClothes(CopyUtil.copyList(filterDetail,DesignItemClothesDetailVO.class,(o,d)->{ + response.setClothes(CopyUtil.copyList(filterDetail, DesignItemClothesDetailVO.class, (o, d) -> { d.setId(o.getBusinessId()); d.setLevel1Type(converTypeToLevel1(o.getType())); String printJson = o.getPrintJson(); - if(StringUtils.isEmpty(printJson)){ + if (StringUtils.isEmpty(printJson)) { d.setPrintObject(new DesignPythonItemPrint(o.getPrintPath(), - CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(),0.3f,Boolean.FALSE)); - }else{ - d.setPrintObject(JSON.parseObject(printJson,DesignPythonItemPrint.class)); + CollectionLevel1TypeEnum.PRINT_BOARD.getRealName(), 0.3f, Boolean.FALSE)); + } else { + d.setPrintObject(JSON.parseObject(printJson, DesignPythonItemPrint.class)); } })); //single 和 Models(模特)时候 系统元素为空 - List filterDetail2 =designItemDetails.stream() + List filterDetail2 = designItemDetails.stream() // .filter(f -> SYS_HAIRSTYLE_SHOES.contains(f.getType()) ) - .filter(f -> SYS_HAIRSTYLE_SHOES_BODY.contains(f.getType()) ) - .collect(Collectors.toList()); - response.setOthers(CopyUtil.copyList(filterDetail2,DesignItemOthersDetailVO.class,(o,d)->{ + .filter(f -> SYS_HAIRSTYLE_SHOES_BODY.contains(f.getType())) + .collect(Collectors.toList()); + response.setOthers(CopyUtil.copyList(filterDetail2, DesignItemOthersDetailVO.class, (o, d) -> { d.setId(o.getBusinessId()); d.setPrintObject(new DesignPythonItemPrint()); })); - return editDesignItemLayer(flag,designPythonOutfit,designItem.getDesignUrl(),editResponseColor(designItemDetails,response)); + return editDesignItemLayer(flag, designPythonOutfit, designItem.getDesignUrl(), editResponseColor(designItemDetails, response)); } - private String converTypeToLevel1(String type){ - if(StringUtils.isEmpty(type)){ + + private String converTypeToLevel1(String type) { + if (StringUtils.isEmpty(type)) { return null; } SysFileLevel2TypeEnum sysFileLevel2TypeEnum = SysFileLevel2TypeEnum.realNameOf(type); - if(Objects.isNull(sysFileLevel2TypeEnum)){ + if (Objects.isNull(sysFileLevel2TypeEnum)) { return null; } - if(OUTWEAR_DRESS_BLOUSE.contains(type) || SKIRT_TROUSERS.contains(type) ){ + if (OUTWEAR_DRESS_BLOUSE.contains(type) || SKIRT_TROUSERS.contains(type)) { return CollectionLevel1TypeEnum.SKETCH_BOARD.getRealName(); } return null; @@ -779,16 +848,17 @@ public class DesignServiceImpl extends ServiceImpl impleme queryWrapper.eq("collection_id", collectionId); return designMapper.selectOne(queryWrapper); } + private int deleteByCollectionId(Long collectionId) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("collection_id", collectionId); Design design = new Design(); design.setCollectionId(0L); - return designMapper.update(design,queryWrapper); + return designMapper.update(design, queryWrapper); } - private Long saveOne(DesignCollectionDTO designDTO,Long collectionId,Long accountId) { - Design design = CopyUtil.copyObject(designDTO,Design.class); + private Long saveOne(DesignCollectionDTO designDTO, Long collectionId, Long accountId) { + Design design = CopyUtil.copyObject(designDTO, Design.class); design.setCreateDate(DateUtil.getByTimeZone(designDTO.getTimeZone())); design.setCollectionId(collectionId); design.setAccountId(accountId); @@ -798,7 +868,7 @@ public class DesignServiceImpl extends ServiceImpl impleme return design.getId(); } - private DesignItemDetailVO editResponseColor(List designItemDetails,DesignItemDetailVO designItemDetailVO){ + private DesignItemDetailVO editResponseColor(List designItemDetails, DesignItemDetailVO designItemDetailVO) { /*designItemDetails.forEach(d -> { if (!StringUtil.isNullOrEmpty(d.getColor())){ PantoneVO pantoneByRgb = panToneService.getPantoneByRgb(d.getColor()); @@ -821,8 +891,8 @@ public class DesignServiceImpl extends ServiceImpl impleme HashMap businessIdColor = new HashMap<>(); designItemDetails.forEach(designItemDetail -> { - if (!StringUtil.isNullOrEmpty(designItemDetail.getColor())){ - businessIdColor.put(designItemDetail.getBusinessId(),designItemDetail.getColor()); + if (!StringUtil.isNullOrEmpty(designItemDetail.getColor())) { + businessIdColor.put(designItemDetail.getBusinessId(), designItemDetail.getColor()); } }); @@ -842,13 +912,13 @@ public class DesignServiceImpl extends ServiceImpl impleme } - private DesignItemDetailVO editDesignItemLayer(Boolean flag,TDesignPythonOutfit designPythonOutfit,String designItemUrl,DesignItemDetailVO designItemDetailVO){ + private DesignItemDetailVO editDesignItemLayer(Boolean flag, TDesignPythonOutfit designPythonOutfit, String designItemUrl, DesignItemDetailVO designItemDetailVO) { ArrayList detailsVO = new ArrayList<>(); - if (flag){ + if (flag) { // 1、判断designPythonOutfitId查出的图层信息是否为空(不允许为空,系统内部错误) List details = designPythonOutfitDetailService.getDetailByDesignPythonOutfitId(designPythonOutfit.getId()); - Assert.notEmpty(details,"Some errors occurred, please restart the design"); + Assert.notEmpty(details, "Some errors occurred, please restart the design"); details.forEach(detail -> { detailsVO.add(designPythonOutfitDetailService.convertToDesignPythonOutfitVO(detail)); }); @@ -872,7 +942,7 @@ public class DesignServiceImpl extends ServiceImpl impleme o.setLayersObject(outfitVOS); }); - }else{ + } else { designItemDetailVO.setDesignItemUrl(designItemUrl); } diff --git a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java index 9672e3c4..418154d7 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java @@ -5,26 +5,22 @@ import com.ai.da.common.config.exception.BusinessException; import com.ai.da.common.context.UserContext; import com.ai.da.common.enums.*; import com.ai.da.common.response.PageBaseResponse; -import com.ai.da.common.response.Response; import com.ai.da.common.utils.CopyUtil; import com.ai.da.common.utils.DateUtil; -import com.ai.da.common.utils.FileUtil; -import com.ai.da.mapper.CollectionElementMapper; +import com.ai.da.common.utils.MinioUtil; import com.ai.da.mapper.LibraryMapper; -import com.ai.da.mapper.UserLikeMapper; import com.ai.da.mapper.entity.*; import com.ai.da.model.dto.*; import com.ai.da.model.vo.*; import com.ai.da.service.LibraryModelPointService; import com.ai.da.service.LibraryService; -import com.ai.da.service.UserLikeService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.google.common.base.Function; -import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; @@ -50,6 +46,12 @@ public class LibraryServiceImpl extends ServiceImpl impl private FileProperties fileProperties; @Resource private LibraryModelPointService libraryModelPointService; + @Resource + private MinioUtil minioUtil; + @Value("minio.bucketName.mannequins") + private String mannequins; + @Value("minio.bucketName.users") + private String users; private static List top = Arrays.asList(CollectionLevel2TypeEnum.DRESS.getRealName(), CollectionLevel2TypeEnum.OUTWEAR.getRealName(),CollectionLevel2TypeEnum.BLOUSE.getRealName()); @@ -143,39 +145,49 @@ public class LibraryServiceImpl extends ServiceImpl impl Assert.isTrue(!( level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD) && StringUtils.isEmpty(libraryUploadDTO.getLevel2Type()) ),"level2Type cannot be empty!"); String path = calculateFileUrl(level1TypeEnum, userInfo.getId()); - File file = FileUtil.upload(libraryUploadDTO.getFile(), path); + String bucketName = null; + switch (level1TypeEnum) { + case MODELS: + bucketName = mannequins; + break; + case MOOD_BOARD: + case PRINT_BOARD: + case SKETCH_BOARD: + bucketName = users; + break; + case MARKETING_SKETCH: + break; + default: + throw new BusinessException("unknown level1_type"); + } + String filePath = minioUtil.upload(bucketName, path, libraryUploadDTO.getFile()); //保存element元素 - Library library = resolveData(libraryUploadDTO, userInfo, file); - saveOne(library); + Library library = resolveData(libraryUploadDTO, userInfo, filePath, bucketName); return CopyUtil.copyObject(library,LibraryUpdateVo.class); } - private Library resolveData(LibraryUploadDTO uploadDTO, AuthPrincipalVo userInfo, File file) { + private Library resolveData(LibraryUploadDTO uploadDTO, AuthPrincipalVo userInfo, String filePath, String bucketName) { Library library = CopyUtil.copyObject(uploadDTO, Library.class); library.setAccountId(userInfo.getId()); - String pictureName = file.getName(); - //获取图片后缀 - String suffix = pictureName.substring(pictureName.lastIndexOf(".")); - //获取图片前缀 - String prefix = pictureName.substring(0,pictureName.lastIndexOf(".")); library.setName(DateUtil.dateToStr(new Date(),DateUtil.YYYY_MM_DD)); - library.setUrl(file.getAbsolutePath()); + library.setUrl(bucketName + File.separator + filePath); //按时区计算 library.setCreateDate(DateUtil.getByTimeZone(uploadDTO.getTimeZone())); - String linuxDomain = fileProperties.getLinuxDomain(); - if (!StringUtils.isEmpty(linuxDomain)) { - //linux 系统 - String oldPath = fileProperties.getSys().getPath(); - library.setUrl(file.getAbsolutePath().replace(oldPath, linuxDomain)); - } +// String linuxDomain = fileProperties.getLinuxDomain(); +// if (!StringUtils.isEmpty(linuxDomain)) { +// //linux 系统 +// String oldPath = fileProperties.getSys().getPath(); +// library.setUrl(file.getAbsolutePath().replace(oldPath, linuxDomain)); +// } + libraryMapper.insert(library); return library; } private String calculateFileUrl(LibraryLevel1TypeEnum level1TypeEnum, Long userId) { - String rootPath = fileProperties.getSys().getPath(); +// String rootPath = fileProperties.getSys().getPath(); String day = DateUtil.dateToStr(new Date(), DateUtil.YYYYMM); - return rootPath + day + File.separator + "userFile" + File.separator + "library" - + File.separator + level1TypeEnum.getRealName() + File.separator + userId + File.separator+UUID.randomUUID().toString(); + return day + File.separator + "userFile" + File.separator + "library" + + File.separator + level1TypeEnum.getRealName() + File.separator + userId; } @Override diff --git a/src/main/java/com/ai/da/service/impl/TDesignPythonOutfitDetailServiceImpl.java b/src/main/java/com/ai/da/service/impl/TDesignPythonOutfitDetailServiceImpl.java index b8286064..63c5e6cf 100644 --- a/src/main/java/com/ai/da/service/impl/TDesignPythonOutfitDetailServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/TDesignPythonOutfitDetailServiceImpl.java @@ -28,7 +28,7 @@ import java.util.Objects; @Service public class TDesignPythonOutfitDetailServiceImpl extends ServiceImpl implements ITDesignPythonOutfitDetailService { - @Value("${minio.bucketName2}") + @Value("${minio.bucketName.clothing}") private String bucketName2; @Resource private MinioUtil minIoUtil; diff --git a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java index e5f0683f..beb75ae2 100644 --- a/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/WorkspaceServiceImpl.java @@ -2,9 +2,15 @@ package com.ai.da.service.impl; import com.ai.da.common.config.exception.BusinessException; import com.ai.da.common.context.UserContext; +import com.ai.da.common.enums.LibraryLevel1TypeEnum; +import com.ai.da.common.enums.SysFileLevel1TypeEnum; +import com.ai.da.common.enums.SysFileLevel2TypeEnum; import com.ai.da.common.response.PageBaseResponse; +import com.ai.da.mapper.LibraryMapper; +import com.ai.da.mapper.SysFileMapper; import com.ai.da.mapper.WorkspaceMapper; -import com.ai.da.mapper.entity.Account; +import com.ai.da.mapper.entity.Library; +import com.ai.da.mapper.entity.SysFile; import com.ai.da.mapper.entity.Workspace; import com.ai.da.model.dto.WorkspaceDTO; import com.ai.da.model.enums.BizJson; @@ -12,26 +18,25 @@ import com.ai.da.model.enums.IEnumDisplay; import com.ai.da.model.enums.Position; import com.ai.da.model.enums.Sex; import com.ai.da.model.vo.AuthPrincipalVo; +import com.ai.da.model.vo.ModelVO; +import com.ai.da.model.vo.ModelsVO; import com.ai.da.model.vo.WorkspaceVO; +import com.ai.da.service.LibraryService; +import com.ai.da.service.SysFileService; import com.ai.da.service.WorkspaceService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.security.core.Authentication; -import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; - import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** - * 服务实现类 + * 服务实现类 * * @author SHAHAIBO * @since 2023-08-01 @@ -39,108 +44,153 @@ import java.util.List; @Service public class WorkspaceServiceImpl extends ServiceImpl implements WorkspaceService { - @Resource - private WorkspaceMapper workspaceMapper; + @Resource + private WorkspaceMapper workspaceMapper; - @Override - public IPage selectWorkspacePage(IPage page, WorkspaceVO workspace) { - return page.setRecords(baseMapper.selectWorkspacePage(page, workspace)); - } + @Resource + private LibraryMapper libraryMapper; - @Override - public boolean saveOrUpdate(Workspace workspace) { - AuthPrincipalVo userInfo = UserContext.getUserHolder(); - workspace.setUserName(userInfo.getUsername()); - workspace.setIsLastIndex(0); - if (null == workspace.getId()) { - int insert = workspaceMapper.insert(workspace); - if (insert <= 0) { - throw new BusinessException("insert workspace failed"); - } - return true; - }else { - int update = workspaceMapper.updateById(workspace); - if (update <= 0) { - throw new BusinessException("update workspace failed"); - } - return true; - } - } + @Resource + private SysFileMapper sysFileMapper; - private final static String WORKSPACE_NAME = "默认workspace名称"; - private final static Integer SYSTEM_DESIGNER_PERCENTAGE = 30; + @Override + public IPage selectWorkspacePage(IPage page, WorkspaceVO workspace) { + return page.setRecords(baseMapper.selectWorkspacePage(page, workspace)); + } - @Override - public WorkspaceVO getPage(WorkspaceDTO query) { - WorkspaceVO vo = new WorkspaceVO(); - String userName = UserContext.getUserHolder().getUsername(); - QueryWrapper qw = new QueryWrapper<>(); - qw.lambda().eq(Workspace::getUserName, userName); - IPage page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw); - if (page.getTotal() == 0L) { - // 给用户新建默认workspace - Workspace workspace = new Workspace(); - workspace.setWorkSpaceName(WORKSPACE_NAME); - workspace.setSex(Sex.MALE.getValue()); - workspace.setSystemDesignerPercentage(SYSTEM_DESIGNER_PERCENTAGE); - workspace.setPosition(Position.OVERALL.getValue()); - workspace.setUserName(userName); - workspace.setIsLastIndex(1); - int insert = workspaceMapper.insert(workspace); - if (insert <= 0) { - throw new BusinessException("save workspace failed"); - } - page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw); - vo.setPage(PageBaseResponse.success(page)); - vo.setId(workspace.getId()); - return vo; - } - vo.setPage(PageBaseResponse.success(page)); - QueryWrapper qwIsLastIndex = new QueryWrapper<>(); - qwIsLastIndex.lambda().eq(Workspace::getUserName, userName); - qwIsLastIndex.lambda().eq(Workspace::getIsLastIndex, 1); - qwIsLastIndex.last("limit 1"); - List workspaces = workspaceMapper.selectList(qwIsLastIndex); - if (CollectionUtils.isEmpty(workspaces)) { - throw new BusinessException("用户工作空间未查询到最后使用标识"); - } - vo.setId(workspaces.get(0).getId()); - return vo; - } + @Override + public boolean saveOrUpdate(Workspace workspace) { + AuthPrincipalVo userInfo = UserContext.getUserHolder(); + workspace.setUserName(userInfo.getUsername()); + workspace.setIsLastIndex(0); + if (null == workspace.getId()) { + int insert = workspaceMapper.insert(workspace); + if (insert <= 0) { + throw new BusinessException("insert workspace failed"); + } + return true; + } else { + int update = workspaceMapper.updateById(workspace); + if (update <= 0) { + throw new BusinessException("update workspace failed"); + } + return true; + } + } - @Override - public List getEnumValues(String className) { - Class clazz; - try { - clazz = Class.forName(IEnumDisplay.class.getPackage().getName() + "." + className); - } catch (ClassNotFoundException e) { - throw new RuntimeException(className + "-枚举类型未找到"); - } - return getEnumValues(clazz); - } + private final static String WORKSPACE_NAME = "默认workspace名称"; + private final static Integer SYSTEM_DESIGNER_PERCENTAGE = 30; - @Override - public Workspace getByIdNew(Long id) { - String userName = UserContext.getUserHolder().getUsername(); - QueryWrapper qwOld = new QueryWrapper<>(); - qwOld.lambda().eq(Workspace::getUserName, userName); - qwOld.lambda().eq(Workspace::getIsLastIndex, 1); - Workspace oldIsLastIndex = workspaceMapper.selectOne(qwOld); - oldIsLastIndex.setIsLastIndex(0); - workspaceMapper.updateById(oldIsLastIndex); - Workspace newIsLastIndex= workspaceMapper.selectById(id); - newIsLastIndex.setIsLastIndex(1); - workspaceMapper.updateById(newIsLastIndex); - return newIsLastIndex; - } + @Override + public WorkspaceVO getPage(WorkspaceDTO query) { + WorkspaceVO vo = new WorkspaceVO(); + String userName = UserContext.getUserHolder().getUsername(); + QueryWrapper qw = new QueryWrapper<>(); + qw.lambda().eq(Workspace::getUserName, userName); + IPage page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw); + if (page.getTotal() == 0L) { + // 给用户新建默认workspace + Workspace workspace = new Workspace(); + workspace.setWorkSpaceName(WORKSPACE_NAME); + workspace.setSex(Sex.MALE.getValue()); + workspace.setSystemDesignerPercentage(SYSTEM_DESIGNER_PERCENTAGE); + workspace.setPosition(Position.OVERALL.getValue()); + workspace.setUserName(userName); + workspace.setIsLastIndex(1); + int insert = workspaceMapper.insert(workspace); + if (insert <= 0) { + throw new BusinessException("save workspace failed"); + } + page = workspaceMapper.selectPage(new Page<>(query.getPage(), query.getSize()), qw); + vo.setPage(PageBaseResponse.success(page)); + vo.setId(workspace.getId()); + return vo; + } + vo.setPage(PageBaseResponse.success(page)); + QueryWrapper qwIsLastIndex = new QueryWrapper<>(); + qwIsLastIndex.lambda().eq(Workspace::getUserName, userName); + qwIsLastIndex.lambda().eq(Workspace::getIsLastIndex, 1); + qwIsLastIndex.last("limit 1"); + List workspaces = workspaceMapper.selectList(qwIsLastIndex); + if (CollectionUtils.isEmpty(workspaces)) { + throw new BusinessException("用户工作空间未查询到最后使用标识"); + } + vo.setId(workspaces.get(0).getId()); + return vo; + } - private List getEnumValues(Class clazz) { - List kvs = new ArrayList(); - IEnumDisplay[] items = (IEnumDisplay[]) clazz.getEnumConstants(); - for (IEnumDisplay item : items) { - kvs.add(new BizJson(item.getValue(), item.name(), null)); - } - return kvs; - } + @Override + public List getEnumValues(String className) { + Class clazz; + try { + clazz = Class.forName(IEnumDisplay.class.getPackage().getName() + "." + className); + } catch (ClassNotFoundException e) { + throw new RuntimeException(className + "-枚举类型未找到"); + } + return getEnumValues(clazz); + } + + @Override + public Workspace getByIdNew(Long id) { + String userName = UserContext.getUserHolder().getUsername(); + QueryWrapper qwOld = new QueryWrapper<>(); + qwOld.lambda().eq(Workspace::getUserName, userName); + qwOld.lambda().eq(Workspace::getIsLastIndex, 1); + Workspace oldIsLastIndex = workspaceMapper.selectOne(qwOld); + oldIsLastIndex.setIsLastIndex(0); + workspaceMapper.updateById(oldIsLastIndex); + Workspace newIsLastIndex = workspaceMapper.selectById(id); + newIsLastIndex.setIsLastIndex(1); + workspaceMapper.updateById(newIsLastIndex); + return newIsLastIndex; + } + + @Override + public List getMannequins() { + AuthPrincipalVo userInfo = UserContext.getUserHolder(); + List result = new ArrayList<>(); + QueryWrapper libraryQueryWrapper = new QueryWrapper<>(); + libraryQueryWrapper.lambda().eq(Library::getAccountId, userInfo.getId()); + libraryQueryWrapper.lambda().eq(Library::getLevel1Type, LibraryLevel1TypeEnum.MODELS.getRealName()); + List libraries = libraryMapper.selectList(libraryQueryWrapper); + if (!CollectionUtils.isEmpty(libraries)) { + List modelVOList = new ArrayList<>(); + for (Library library : libraries) { + ModelVO modelVO = new ModelVO(); + modelVO.setId(library.getId()); + modelVO.setUrl(library.getUrl()); + } + ModelsVO vo = new ModelsVO(); + vo.setModelList(modelVOList); + vo.setType("Library"); + result.add(vo); + } + QueryWrapper sysFileQueryWrapper = new QueryWrapper<>(); + sysFileQueryWrapper.lambda().eq(SysFile::getLevel1Type, SysFileLevel1TypeEnum.ACCESSORIES.getRealName()); + sysFileQueryWrapper.lambda().eq(SysFile::getLevel2Type, SysFileLevel2TypeEnum.BODY.getRealName()); + List sysFileList = sysFileMapper.selectList(sysFileQueryWrapper); + if (!CollectionUtils.isEmpty(sysFileList)) { + List modelVOList = new ArrayList<>(); + for (SysFile sysFile : sysFileList) { + ModelVO modelVO = new ModelVO(); + modelVO.setId(sysFile.getId()); + modelVO.setUrl(sysFile.getUrl()); + } + ModelsVO vo = new ModelsVO(); + vo.setModelList(modelVOList); + vo.setType("System"); + result.add(vo); + } + return result; + } + + private List getEnumValues(Class clazz) { + List kvs = new ArrayList(); + IEnumDisplay[] items = (IEnumDisplay[]) clazz.getEnumConstants(); + for (IEnumDisplay item : items) { + kvs.add(new BizJson(item.getValue(), item.name(), null)); + } + return kvs; + } } diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index c38b6ef3..36690e19 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -1,10 +1,11 @@ -server.port=5566 +server.port=5567 #datasource spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.datasource.url=jdbc:mysql://18.167.251.121:3306/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true +spring.datasource.url=jdbc:mysql://18.167.251.121:33006/aida?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true spring.datasource.username=root -spring.datasource.password=QWa998345 +spring.datasource.password=root +#spring.datasource.password=QWa998345 #security spring.security.jwtSecret=JWTSECRET @@ -14,7 +15,7 @@ spring.security.jwtTokenPrefix=Bearer- spring.security.jwtExpiration=8640000000 #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ - /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/** + /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/workspace/** spring.security.authApi=/auth/login @@ -24,6 +25,9 @@ rsa.private_key=MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEA0vfvyTdGJkdbHkB8 mybatis-plus.global-config.banner=false mybatis-plus.mapper-locations=classpath:mapper/*Mapper.xml #mybatis-plus.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl +mybatis-plus.global-config.db-config.logic-delete-field=isDeleted +mybatis-plus.global-config.db-config.logic-delete-value=1 +mybatis-plus.global-config.db-config.logic-not-delete-value=0 spring.mvc.pathmatch.matching-strategy=ant_path_matcher @@ -36,3 +40,14 @@ spring.servlet.multipart.max-file-size = 5MB spring.servlet.multipart.max-request-size= 5MB #访问python服务的ip(对应环境) access.python.ip=http://43.198.80.117 +#access.python.ip=http://18.167.251.121 +#access.python.ip=http://18.167.251.121:9991/ + +minio.endpoint=http://18.167.251.121:9000 +minio.accessKey=minioadmin +minio.secretKey=minioadmin +minio.bucketName.clothing=aida-clothing +minio.bucketName.mannequins=aida-mannequins +minio.bucketName.results=aida-results +minio.bucketName.sysImage=aida-sys-image +minio.bucketName.users=aida-users \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e8510ce9..bc2b535d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,5 @@ #����application-test�ļ�(���Ի���) -spring.profiles.active=test +spring.profiles.active=prod #����application-prod�ļ�(��������) #spring.profiles.active=prod