TASK:模块化;
This commit is contained in:
@@ -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打点")
|
||||
|
||||
@@ -40,4 +40,6 @@ public class LibraryUploadDTO {
|
||||
|
||||
private String modelSex;
|
||||
|
||||
private String ageGroup;
|
||||
|
||||
}
|
||||
|
||||
31
src/main/java/com/ai/da/model/enums/AgeGroup.java
Normal file
31
src/main/java/com/ai/da/model/enums/AgeGroup.java
Normal file
@@ -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 + "]");
|
||||
}
|
||||
}
|
||||
@@ -1267,10 +1267,10 @@ public class DesignServiceImpl extends ServiceImpl<DesignMapper, Design> 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,先不做
|
||||
|
||||
@@ -728,6 +728,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> 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<LibraryMapper, Library> impl
|
||||
}
|
||||
sysFile.setLevel1Type("Models");
|
||||
sysFile.setLevel2Type(uploadDTO.getModelSex());
|
||||
sysFile.setLevel3Type(uploadDTO.getAgeGroup());
|
||||
sysFile.setUrl(filePath);
|
||||
sysFile.setMd5(uploadDTO.getMd5());
|
||||
sysFile.setCreateDate(new Date());
|
||||
|
||||
Reference in New Issue
Block a user