TASK:作品更新接口,将通过projectId替换userLikeGroupId
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
package com.ai.da.model.dto;
|
||||
|
||||
import com.ai.da.mapper.primary.entity.Portfolio;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -10,5 +13,7 @@ public class PortfolioDTO extends Portfolio {
|
||||
|
||||
private List<TagsDTO> tagsDTO;
|
||||
|
||||
@ApiModelProperty("项目id")
|
||||
@NotNull
|
||||
private Long projectId;
|
||||
}
|
||||
|
||||
@@ -147,9 +147,9 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
throw new BusinessException("The title of the published work has been used.");
|
||||
}
|
||||
// 判断用户是否参与#RCAworkshop_2024的活动
|
||||
if (hasParticipatedRCAWorkshop(authPrincipalVo.getId(), portfolioDTO.getTagsDTO(), portfolioDTO.getId(), portfolioDTO.getUserLikeGroupId())){
|
||||
throw new BusinessException("you.have.participated.in.the.event", ResultEnum.PROMPT.getCode());
|
||||
}
|
||||
// if (hasParticipatedRCAWorkshop(authPrincipalVo.getId(), portfolioDTO.getTagsDTO(), portfolioDTO.getId(), portfolioDTO.getUserLikeGroupId())){
|
||||
// throw new BusinessException("you.have.participated.in.the.event", ResultEnum.PROMPT.getCode());
|
||||
// }
|
||||
if (file != null && file.getOriginalFilename() != null) {
|
||||
Long portfolioId;
|
||||
// 上传画布到minio
|
||||
@@ -295,7 +295,12 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
throw new BusinessException("The title of the published work has been used.");
|
||||
}
|
||||
if (portfolioDTO.getPortfolioType().equals("History")) {
|
||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId());
|
||||
UserLikeGroup likeGroup = userLikeGroupMapper.selectOne(new QueryWrapper<UserLikeGroup>().eq("project_id", portfolioDTO.getProjectId()));
|
||||
if (Objects.isNull(likeGroup)){
|
||||
return null;
|
||||
}
|
||||
Long userLikeGroupId = likeGroup.getId();
|
||||
UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(userLikeGroupId);
|
||||
UserLikeGroup userLikeGroupNew = userLikeGroup.setId(null);
|
||||
userLikeGroupNew.setAccountId(-1L);
|
||||
Long collectionIdOld = userLikeGroup.getCollectionId();
|
||||
@@ -316,7 +321,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
collectionElementRelationNew.setElementId(element.getId());
|
||||
collectionElementRelationMapper.insert(collectionElementRelationNew);
|
||||
}
|
||||
Portfolio portfolio = getPortfolioByUserGroupIdSource(portfolioDTO.getUserLikeGroupId());
|
||||
Portfolio portfolio = getPortfolioByUserGroupIdSource(userLikeGroupId);
|
||||
Long coverIdOld = portfolioDTO.getCoverId();
|
||||
portfolio.setPortfolioName(portfolioDTO.getPortfolioName());
|
||||
// portfolio.setPortfolioType("History");
|
||||
@@ -328,7 +333,7 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
||||
portfolio.setIsDeleted(0);
|
||||
portfolioMapper.updateById(portfolio);
|
||||
|
||||
List<UserLike> userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId());
|
||||
List<UserLike> userLikeList = userLikeService.getUserLikeList(userLikeGroupId);
|
||||
|
||||
Long coverIdNew = null;
|
||||
Boolean flag = false;
|
||||
|
||||
Reference in New Issue
Block a user