TASK:AiDA模块化
This commit is contained in:
@@ -192,8 +192,8 @@ public class SavedCollectionController {
|
|||||||
|
|
||||||
@ApiOperation(value = "toProductImageElementUpload")
|
@ApiOperation(value = "toProductImageElementUpload")
|
||||||
@PostMapping("/toProductImageElementUpload")
|
@PostMapping("/toProductImageElementUpload")
|
||||||
public Response<ToProductElementVO> toProductImageElementUpload(@RequestParam("file") MultipartFile file, @RequestParam(value = "userlikeGroupId") Long userLikeGroupId) {
|
public Response<ToProductElementVO> toProductImageElementUpload(@RequestParam("file") MultipartFile file, @RequestParam(value = "projectId") Long projectId) {
|
||||||
return Response.success(userLikeGroupService.toProductImageElementUpload(file, userLikeGroupId));
|
return Response.success(userLikeGroupService.toProductImageElementUpload(file, projectId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "productImageLike")
|
@ApiOperation(value = "productImageLike")
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ public class ToProductElement implements Serializable {
|
|||||||
@ApiModelProperty(value = "userLikeGroupId")
|
@ApiModelProperty(value = "userLikeGroupId")
|
||||||
private Long userLikeGroupId;
|
private Long userLikeGroupId;
|
||||||
|
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "url")
|
@ApiModelProperty(value = "url")
|
||||||
private String url;
|
private String url;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public interface UserLikeGroupService extends IService<UserLikeGroup> {
|
|||||||
|
|
||||||
void toProduct(String taskId);
|
void toProduct(String taskId);
|
||||||
|
|
||||||
ToProductElementVO toProductImageElementUpload(MultipartFile file, Long userLikeGroupId);
|
ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId);
|
||||||
|
|
||||||
Boolean productImageLike(ProductImageLikeDTO productImageLikeDTO);
|
Boolean productImageLike(ProductImageLikeDTO productImageLikeDTO);
|
||||||
|
|
||||||
|
|||||||
@@ -568,19 +568,20 @@ public class UserLikeGroupServiceImpl extends ServiceImpl<UserLikeGroupMapper, U
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public ToProductElementVO toProductImageElementUpload(MultipartFile file, Long userLikeGroupId) {
|
public ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId) {
|
||||||
if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) {
|
if (null == file || StringUtils.isEmpty(file.getOriginalFilename())) {
|
||||||
throw new BusinessException("file.cannot.be.empty");
|
throw new BusinessException("file.cannot.be.empty");
|
||||||
}
|
}
|
||||||
if (userLikeGroupId == null) {
|
if (projectId == null) {
|
||||||
throw new BusinessException("userLikeGroupId.cannot.be.empty");
|
throw new BusinessException("projectId.cannot.be.empty");
|
||||||
}
|
}
|
||||||
AuthPrincipalVo userHolder = UserContext.getUserHolder();
|
AuthPrincipalVo userHolder = UserContext.getUserHolder();
|
||||||
String bucketName = "aida-users";
|
String bucketName = "aida-users";
|
||||||
String minioUrl = minioUtil.upload(bucketName, userHolder.getId() + "/toProductImageElement", file);
|
String minioUrl = minioUtil.upload(bucketName, userHolder.getId() + "/toProductImageElement", file);
|
||||||
ToProductElement toProductElement = new ToProductElement();
|
ToProductElement toProductElement = new ToProductElement();
|
||||||
toProductElement.setUrl(minioUrl);
|
toProductElement.setUrl(minioUrl);
|
||||||
toProductElement.setUserLikeGroupId(userLikeGroupId);
|
// toProductElement.setUserLikeGroupId(userLikeGroupId);
|
||||||
|
toProductElement.setProjectId(projectId);
|
||||||
toProductElement.setCreateTime(LocalDateTime.now());
|
toProductElement.setCreateTime(LocalDateTime.now());
|
||||||
toProductElementMapper.insert(toProductElement);
|
toProductElementMapper.insert(toProductElement);
|
||||||
ToProductElementVO toProductElementVO = CopyUtil.copyObject(toProductElement, ToProductElementVO.class);
|
ToProductElementVO toProductElementVO = CopyUtil.copyObject(toProductElement, ToProductElementVO.class);
|
||||||
|
|||||||
Reference in New Issue
Block a user