diff --git a/src/main/java/com/ai/da/controller/LibraryController.java b/src/main/java/com/ai/da/controller/LibraryController.java index 3330da02..276cd94d 100644 --- a/src/main/java/com/ai/da/controller/LibraryController.java +++ b/src/main/java/com/ai/da/controller/LibraryController.java @@ -73,6 +73,7 @@ public class LibraryController { @RequestParam(value = "timeZone") String timeZone, @RequestParam(value = "modelType") String modelType, @RequestParam(value = "sex") String sex, + @RequestParam(value = "ageGroup") String ageGroup, @RequestParam(value = "checkMd5") Integer checkMd5) { if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) { throw new BusinessException("file.cannot.be.empty"); @@ -99,7 +100,7 @@ public class LibraryController { } } return Response.success(libraryService.upload(new LibraryUploadDTO(file, level1Type, level2Type, - timeZone, md5, high, width, modelType, sex))); + timeZone, md5, high, width, modelType, sex, ageGroup))); } @ApiOperation(value = "保存或者编辑template打点") diff --git a/src/main/java/com/ai/da/model/dto/LibraryUploadDTO.java b/src/main/java/com/ai/da/model/dto/LibraryUploadDTO.java index cd6e149d..8f24f424 100644 --- a/src/main/java/com/ai/da/model/dto/LibraryUploadDTO.java +++ b/src/main/java/com/ai/da/model/dto/LibraryUploadDTO.java @@ -40,4 +40,6 @@ public class LibraryUploadDTO { private String modelSex; + private String ageGroup; + } diff --git a/src/main/java/com/ai/da/model/enums/AgeGroup.java b/src/main/java/com/ai/da/model/enums/AgeGroup.java new file mode 100644 index 00000000..e5f576ae --- /dev/null +++ b/src/main/java/com/ai/da/model/enums/AgeGroup.java @@ -0,0 +1,31 @@ +package com.ai.da.model.enums; + +import com.fasterxml.jackson.annotation.JsonValue; +import lombok.Data; + +public enum AgeGroup implements IEnumDisplay { + ADULT("Adult"), + CHILD("Child") + ; + + private String value; + + AgeGroup(String value) { + this.value = value; + } + + @Override + @JsonValue + public String getValue() { + return this.value; + } + + public static AgeGroup getAgeGroup(String value) { + for (AgeGroup group : values()) { + if (group.value.equalsIgnoreCase(value)) { + return group; + } + } + throw new IllegalArgumentException("No matching constant for [" + value + "]"); + } +} diff --git a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java index fbd7ede3..37201c11 100644 --- a/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/DesignServiceImpl.java @@ -1267,10 +1267,10 @@ public class DesignServiceImpl extends ServiceImpl impleme if (Objects.isNull(design)) { throw new BusinessException("design.detail.not.found"); } - if (!userLike.getDesignId().equals(disDesignLikeDTO.getDesignId())) { - //不是相同的design不会合并 - return Boolean.TRUE; - } +// if (!userLike.getDesignId().equals(disDesignLikeDTO.getDesignId())) { +// //不是相同的design不会合并 +// return Boolean.TRUE; +// } //修改designItem为dislike状态 designItemService.updateLikeStatus(userLike.getDesignItemId(), (byte) 0); //删除关联的collection,先不做 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 5a4cf88d..2a581a29 100644 --- a/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/LibraryServiceImpl.java @@ -728,6 +728,7 @@ public class LibraryServiceImpl extends ServiceImpl impl library.setCreateDate(DateUtil.getByTimeZone(uploadDTO.getTimeZone())); if (uploadDTO.getModelType().equals(ModelType.LIBRARY.getValue())) { library.setLevel2Type(uploadDTO.getModelSex()); + library.setLevel3Type(uploadDTO.getAgeGroup()); } else { library.setLevel3Type(uploadDTO.getModelSex()); } @@ -749,6 +750,7 @@ public class LibraryServiceImpl extends ServiceImpl impl } sysFile.setLevel1Type("Models"); sysFile.setLevel2Type(uploadDTO.getModelSex()); + sysFile.setLevel3Type(uploadDTO.getAgeGroup()); sysFile.setUrl(filePath); sysFile.setMd5(uploadDTO.getMd5()); sysFile.setCreateDate(new Date());