TASK:模特相关接口;

This commit is contained in:
shahaibo
2023-10-04 06:47:48 +08:00
parent 612fb61ac1
commit ee32111599
15 changed files with 127 additions and 43 deletions

View File

@@ -3,6 +3,7 @@ package com.ai.da.controller;
import cn.hutool.core.lang.Assert;
import cn.hutool.system.UserInfo;
import com.ai.da.common.config.FileProperties;
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.response.PageBaseResponse;
@@ -68,17 +69,25 @@ public class LibraryController {
@ApiParam("二级类型 争对 Sketchboard; 有 Outwear Dress Blouse Skirt Trousers")
@RequestParam(value = "level2Type",required = false) String level2Type,
@ApiParam("本地时区,比如 'Asia/Tokyo' 东京时间 , 'Asia/Shanghai' 北京时间 由js本地获取")
@RequestParam(value = "timeZone") String timeZone) {
@RequestParam(value = "timeZone") String timeZone,
@RequestParam(value = "modelType") String modelType,
@RequestParam(value = "sex") String sex) {
Assert.isTrue(!StringUtils.isEmpty(file.getOriginalFilename()),"Please select a file!");
Integer high =null;
Integer width =null;
if(level1Type.equals(LibraryLevel1TypeEnum.MODELS.getRealName())){
if (StringUtils.isEmpty(modelType)) {
throw new BusinessException("modelType can't be null");
}
if (StringUtils.isEmpty(sex)) {
throw new BusinessException("sex can't be null");
}
FileVO fileVO = FileUtil.getFileSize(file);
high = fileVO.getHigh();
width = fileVO.getWidth();
}
return Response.success(libraryService.upload(new LibraryUploadDTO(file, level1Type,level2Type,
timeZone, MD5Utils.encryptFile(file),high,width)));
timeZone, MD5Utils.encryptFile(file),high,width,modelType,sex)));
}
@ApiOperation(value = "保存或者编辑template打点")
@PostMapping("/saveOrEditTemplatePoint")

View File

@@ -94,8 +94,8 @@ public class WorkspaceController {
@GetMapping("/getMannequins")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "获取模特")
public Response<List<ModelsVO>> getMannequins() {
List<ModelsVO> modelsVO = workspaceService.getMannequins();
public Response<List<ModelsVO>> getMannequins(@RequestParam("sex") String sex) {
List<ModelsVO> modelsVO = workspaceService.getMannequins(sex);
return Response.success(modelsVO);
}