TASK:AiDA模块化
This commit is contained in:
@@ -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