BUGFIX: format;
This commit is contained in:
@@ -57,31 +57,31 @@ public class LibraryController {
|
||||
@ApiOperation(value = "Library分页列表")
|
||||
@PostMapping("/queryLibraryPage")
|
||||
public Response<PageBaseResponse<QueryLibraryPageVO>> queryLibraryPage(@Valid @RequestBody QueryLibraryPageDTO query) {
|
||||
return Response.success(libraryService.queryLibraryPage(CopyUtil.copyObject(query,QueryLibraryPageServiceDTO.class)));
|
||||
return Response.success(libraryService.queryLibraryPage(CopyUtil.copyObject(query, QueryLibraryPageServiceDTO.class)));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "Library分页列表(查询top和bottom)")
|
||||
@PostMapping("/queryLibraryTopAndBottomPage")
|
||||
public Response<PageBaseResponse<QueryLibraryPageVO>> queryLibraryTopAndBottomPage(@Valid @RequestBody QueryLibraryTopPageDTO query) {
|
||||
return Response.success(libraryService.queryLibraryPage(CopyUtil.copyObject(query,QueryLibraryPageServiceDTO.class)));
|
||||
return Response.success(libraryService.queryLibraryPage(CopyUtil.copyObject(query, QueryLibraryPageServiceDTO.class)));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "Library文件上传")
|
||||
@PostMapping("/upload")
|
||||
public Response<LibraryUpdateVo> upload(@RequestParam("file") MultipartFile file,
|
||||
@ApiParam("一级类型 Moodboard Printboard Sketchboard MarketingSketch Models")
|
||||
@RequestParam(value = "level1Type") String level1Type,
|
||||
@RequestParam(value = "level1Type") String level1Type,
|
||||
@ApiParam("二级类型 争对 Sketchboard; 有 Outwear Dress Blouse Skirt Trousers")
|
||||
@RequestParam(value = "level2Type",required = false) String level2Type,
|
||||
@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,
|
||||
@RequestParam(value = "checkMd5") Integer checkMd5) {
|
||||
Assert.isTrue(!StringUtils.isEmpty(file.getOriginalFilename()),"Please select a file!");
|
||||
Integer high =null;
|
||||
Integer width =null;
|
||||
if(level1Type.equals(LibraryLevel1TypeEnum.MODELS.getRealName())){
|
||||
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");
|
||||
}
|
||||
@@ -100,14 +100,16 @@ public class LibraryController {
|
||||
return Response.success(libraryUpdateVo);
|
||||
}
|
||||
}
|
||||
return Response.success(libraryService.upload(new LibraryUploadDTO(file, level1Type,level2Type,
|
||||
timeZone, md5,high,width,modelType,sex)));
|
||||
return Response.success(libraryService.upload(new LibraryUploadDTO(file, level1Type, level2Type,
|
||||
timeZone, md5, high, width, modelType, sex)));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "保存或者编辑template打点")
|
||||
@PostMapping("/saveOrEditTemplatePoint")
|
||||
public Response<LibraryModelPointVO> saveOrEditTemplatePoint(@Valid @RequestBody LibraryModelPointDTO libraryModelPoint) {
|
||||
return Response.success(libraryModelPointService.saveOrEditTemplatePoint(libraryModelPoint));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量Library修改用户文件名")
|
||||
@PostMapping("/batchUpdateLibraryName")
|
||||
public Response<Boolean> batchUpdateLibraryName(@Valid @RequestBody LibraryUpdateDTO libraryUpdateDTO) {
|
||||
@@ -119,7 +121,7 @@ public class LibraryController {
|
||||
@PostMapping("/batchDeleteLibrary")
|
||||
public Response<Boolean> batchDeleteLibrary(@Valid @RequestBody LibraryDeleteDTO deleteDTO) {
|
||||
List<Library> librarys = libraryService.getByIds(deleteDTO.getLibraryIds());
|
||||
Assert.notEmpty(librarys,"librarys does not exist!");
|
||||
Assert.notEmpty(librarys, "librarys does not exist!");
|
||||
libraryService.removeBatchByIds(deleteDTO.getLibraryIds());
|
||||
for (Library library : librarys) {
|
||||
if (library.getUrl().startsWith(sysImage)) {
|
||||
@@ -133,10 +135,10 @@ public class LibraryController {
|
||||
|
||||
@ApiOperation(value = "Models打点预览")
|
||||
@PostMapping("/modelsDot")
|
||||
public Response<String> modelsDot(@ApiParam("file") @RequestPart(value = "file",required = false) MultipartFile file,
|
||||
@ApiParam("models对象")@RequestPart("models") ModelsDotDTO modelsDotDTO) {
|
||||
if(Objects.nonNull(file)){
|
||||
Assert.isTrue(!StringUtils.isEmpty(file.getOriginalFilename()),"Please select a file!");
|
||||
public Response<String> modelsDot(@ApiParam("file") @RequestPart(value = "file", required = false) MultipartFile file,
|
||||
@ApiParam("models对象") @RequestPart("models") ModelsDotDTO modelsDotDTO) {
|
||||
if (Objects.nonNull(file)) {
|
||||
Assert.isTrue(!StringUtils.isEmpty(file.getOriginalFilename()), "Please select a file!");
|
||||
AuthPrincipalVo userInfo = UserContext.getUserHolder();
|
||||
//需要宽高和地址参数design
|
||||
FileVO fileVO = FileUtil.getFileSize(file);
|
||||
@@ -147,18 +149,18 @@ public class LibraryController {
|
||||
String uploadPath = minioUtil.upload("aida-tmp", path, file);
|
||||
String minioPath = libraryService.processMannequins(uploadPath);
|
||||
modelsDotDTO.setTemplateUrl(minioPath);
|
||||
}else{
|
||||
Assert.notNull(modelsDotDTO.getLibraryId(),"libraryId cannot be empty!");
|
||||
Assert.notNull(modelsDotDTO.getTemplateId(),"templateId cannot be empty!");
|
||||
} else {
|
||||
Assert.notNull(modelsDotDTO.getLibraryId(), "libraryId cannot be empty!");
|
||||
Assert.notNull(modelsDotDTO.getTemplateId(), "templateId cannot be empty!");
|
||||
LibraryModelPoint modelPoint = libraryModelPointService.getById(modelsDotDTO.getTemplateId());
|
||||
Assert.notNull(modelPoint,"template does not exist!");
|
||||
Assert.notNull(modelPoint, "template does not exist!");
|
||||
Library library = libraryService.getById(modelsDotDTO.getLibraryId());
|
||||
Assert.notNull(library,"library does not exist!");
|
||||
Assert.notNull(library, "library does not exist!");
|
||||
modelsDotDTO.setHigh(library.getHigh());
|
||||
modelsDotDTO.setWidth(library.getWidth());
|
||||
modelsDotDTO.setTemplateUrl(library.getUrl());
|
||||
}
|
||||
Response<String> response =new Response();
|
||||
Response<String> response = new Response();
|
||||
log.info("Models打点预览入参####{}", JSON.toJSONString(modelsDotDTO));
|
||||
String url = libraryModelPointService.modelsDot(modelsDotDTO);
|
||||
response.setData(minioUtil.getPresignedUrl(url, 24 * 60));
|
||||
@@ -174,14 +176,14 @@ public class LibraryController {
|
||||
private String calculateTempFileUrl(Long userId) {
|
||||
String rootPath = fileProperties.getSys().getPath();
|
||||
String day = DateUtil.dateToStr(new Date(), DateUtil.YYYYMM);
|
||||
return rootPath + day + File.separator + "tmp" + File.separator + userId + File.separator+ UUID.randomUUID().toString();
|
||||
return rootPath + day + File.separator + "tmp" + File.separator + userId + File.separator + UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
private String calculateTempFileUrlNew(Long userId) {
|
||||
return userId.toString();
|
||||
}
|
||||
|
||||
private String calculateTemplateUrl(File uploadFile){
|
||||
private String calculateTemplateUrl(File uploadFile) {
|
||||
String linuxDomain = fileProperties.getLinuxDomain();
|
||||
if (!StringUtils.isEmpty(linuxDomain)) {
|
||||
//linux 系统
|
||||
|
||||
Reference in New Issue
Block a user