TASK:workspace;

This commit is contained in:
shahaibo
2024-05-27 15:05:46 +08:00
parent 8b274b2822
commit 4ba5f63a62
6 changed files with 121 additions and 14 deletions

View File

@@ -13,6 +13,8 @@ import com.ai.da.mapper.primary.ClassificationRelLibraryMapper;
import com.ai.da.mapper.primary.entity.Classification;
import com.ai.da.mapper.primary.entity.ClassificationRelLibrary;
import com.ai.da.model.dto.ClassificationDTO;
import com.ai.da.model.enums.DesignElementsEnum;
import com.ai.da.model.enums.Language;
import com.ai.da.model.vo.AuthPrincipalVo;
import com.ai.da.model.vo.ClassificationVO;
import com.ai.da.service.ClassificationService;
@@ -106,7 +108,19 @@ public class ClassificationServiceImpl implements ClassificationService {
List<Classification> classificationList = classificationMapper.selectList(qw);
if (CollectionUtil.isNotEmpty(classificationList)) {
// 获取结果集
return getClassificationVOList(classificationList);
List<ClassificationVO> classificationVOList = getClassificationVOList(classificationList);
if (classificationDTO.getType().equals("DesignElements")) {
for (ClassificationVO classificationVO : classificationVOList) {
String classificationName = classificationVO.getClassificationName();
DesignElementsEnum designElementsEnum = DesignElementsEnum.fromName(classificationName);
if (userHolder.getLanguage().equals(Language.ENGLISH.name())) {
classificationVO.setClassificationName(designElementsEnum.getEnglish());
}else {
classificationVO.setClassificationName(designElementsEnum.getChinese());
}
}
}
return classificationVOList;
}
return new ArrayList<>();
}

View File

@@ -130,10 +130,10 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
queryWrapper.eq("level2_type", query.getModelSex());
}
if (!StringUtils.isEmpty(query.getLevel2Type())) {
CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(query.getLevel2Type());
if (Objects.isNull(level2TypeEnum)) {
throw new BusinessException("unknown.parameter.level2Type");
}
// CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(query.getLevel2Type());
// if (Objects.isNull(level2TypeEnum)) {
// throw new BusinessException("unknown.parameter.level2Type");
// }
queryWrapper.eq("level2_type", query.getLevel2Type());
}
if (!StringUtils.isEmpty(query.getType())) {
@@ -228,13 +228,13 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
if (Objects.isNull(level1TypeEnum)) {
throw new BusinessException("unknown.parameter.level1Type");
}
if (!StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(libraryUploadDTO.getLevel2Type());
if (Objects.isNull(level2TypeEnum)) {
throw new BusinessException("unknown.parameter.level2Type");
}
}
if (level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD) && StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
// if (!StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
// CollectionLevel2TypeEnum level2TypeEnum = CollectionLevel2TypeEnum.of(libraryUploadDTO.getLevel2Type());
// if (Objects.isNull(level2TypeEnum)) {
// throw new BusinessException("unknown.parameter.level2Type");
// }
// }
if ((level1TypeEnum.equals(LibraryLevel1TypeEnum.SKETCH_BOARD) || level1TypeEnum.equals(LibraryLevel1TypeEnum.PRINT_BOARD) || level1TypeEnum.equals(LibraryLevel1TypeEnum.DESIGN_ELEMENTS)) && StringUtils.isEmpty(libraryUploadDTO.getLevel2Type())) {
throw new BusinessException("level2Type.cannot.be.empty");
}
String path = calculateFileUrl(level1TypeEnum, libraryUploadDTO.getLevel2Type(), libraryUploadDTO.getModelSex(), userInfo.getId());
@@ -244,6 +244,7 @@ public class LibraryServiceImpl extends ServiceImpl<LibraryMapper, Library> impl
case MOOD_BOARD:
case PRINT_BOARD:
case SKETCH_BOARD:
case DESIGN_ELEMENTS:
bucketName = users;
break;
case MARKETING_SKETCH: