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