TASK: 拼贴功能保存用户上传的图片并返回

This commit is contained in:
2025-07-15 18:11:12 +08:00
parent 64318de24a
commit 301f58bc62
6 changed files with 54 additions and 4 deletions

View File

@@ -53,13 +53,15 @@ public class ElementController {
@ApiParam("一级类型 Moodboard Printboard Sketchboard MarketingSketch Colorboard")
@RequestParam(value = "level1Type") String level1Type,
@RequestParam(name = "gender", required = false) String gender,
@RequestParam(name = "level2Type", required = false) String level2Type,
@RequestParam(name = "projectId", required = false) Long projectId,
@ApiParam("本地时区,比如 'Asia/Tokyo' 东京时间 , 'Asia/Shanghai' 北京时间 由js本地获取")
@RequestParam(value = "timeZone") String timeZone) {
if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) {
throw new BusinessException("file.cannot.be.empty");
}
return Response.success(collectionElementService.upload(
new CollectionElementUploadDTO(file, level1Type, gender, timeZone, MD5Utils.encryptFile(file))));
new CollectionElementUploadDTO(file, projectId, level1Type, level2Type, gender, timeZone, MD5Utils.encryptFile(file))));
}
@ApiOperation(value = "element文件删除")
@@ -131,4 +133,11 @@ public class ElementController {
return Response.success(collectionElementService.selectedImageSeg(nonEmptyFiles, id, type, sourceType));
}
@ApiOperation(value = "更新element level2type")
@GetMapping("/updateElementLevel2Type")
public Response<String> updateLibraryLevel2Type(@RequestParam(value = "elementId") Long elementId, @RequestParam(value = "level2Type") String level2Type) {
collectionElementService.updateElementLevel2Type(elementId, level2Type);
return Response.success("success");
}
}