TASK:AiDA模块化

This commit is contained in:
shahaibo
2025-03-19 14:13:16 +08:00
parent 83d9a5befb
commit 55ec6da74b
4 changed files with 10 additions and 7 deletions

View File

@@ -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);

View File

@@ -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);