diff --git a/src/main/java/com/ai/da/controller/SavedCollectionController.java b/src/main/java/com/ai/da/controller/SavedCollectionController.java index 3942b5aa..b3f51429 100644 --- a/src/main/java/com/ai/da/controller/SavedCollectionController.java +++ b/src/main/java/com/ai/da/controller/SavedCollectionController.java @@ -49,6 +49,8 @@ public class SavedCollectionController { private MinioUtil minioUtil; @Resource private ClassificationService classificationService; + @Resource + private PortfolioService portfolioService; @ApiOperation(value = "History用户分页分组列表") @PostMapping("/queryUserGroup") @@ -122,6 +124,10 @@ public class SavedCollectionController { } userLikeGroupVO.setGroupDetails(details); userLikeGroupVO.setSketchCount(CollectionUtils.isEmpty(details) ? 0 : details.size()); + if (userLikeGroupVO.getOriginal() == 0) { + userLikeGroupVO.setOriginalAccountName(accountService.getById(userLikeGroupVO.getOriginalAccountId()).getUserName()); + userLikeGroupVO.setOriginalPortfolioName(portfolioService.getById(userLikeGroupVO.getOriginalPortfolioId()).getPortfolioName()); + } return userLikeGroupVO; } return null; diff --git a/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java b/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java index e51f5fd7..93263027 100644 --- a/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java +++ b/src/main/java/com/ai/da/model/dto/ToProductImageDTO.java @@ -12,4 +12,5 @@ public class ToProductImageDTO { private List toProductImageVOList; private String prompt; private BigDecimal imageStrength; + private String direction; } diff --git a/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java b/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java index 2aabb67d..fb313f1a 100644 --- a/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java +++ b/src/main/java/com/ai/da/model/vo/MagicToolResultVO.java @@ -22,4 +22,6 @@ public class MagicToolResultVO { private String category; private String sourceUrl; + + private String resultType; } diff --git a/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java b/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java index 8f35521b..34d207b6 100644 --- a/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java +++ b/src/main/java/com/ai/da/model/vo/UserLikeGroupVO.java @@ -26,6 +26,8 @@ public class UserLikeGroupVO { private Long originalAccountId; + private Long originalPortfolioId; + @ApiModelProperty("更新时间") private Long updateDate; @@ -35,4 +37,7 @@ public class UserLikeGroupVO { @ApiModelProperty("分组对应的详情 一次行带出来") private List groupDetails; + private String originalAccountName; + private String originalPortfolioName; + } diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 6e0d1d10..c5c5132e 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -3355,7 +3355,7 @@ public class PythonService { throw new BusinessException("toProductImage.interface.exception"); } - public Boolean relight(String url, String taskId, String prompt) { + public Boolean relight(String url, String taskId, String prompt, String direction) { // todo 限流校验 // AccessLimitUtils.validate("design",5); OkHttpClient client = new OkHttpClient().newBuilder() @@ -3370,6 +3370,7 @@ public class PythonService { map.put("tasks_id", taskId); map.put("image_url", url); map.put("prompt", prompt); + map.put("direction", direction); log.info("relightImage请求python 参数:####{}", map); String param = JSON.toJSONString(map, SerializerFeature.WriteNullStringAsEmpty); log.info(param); diff --git a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java index 0a320af5..9742ebc1 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -103,17 +103,27 @@ public class PortfolioServiceImpl extends ServiceImpl existSameNameQw = new QueryWrapper<>(); existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName()); + existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId()); List portfoliosSameName = portfolioMapper.selectList(existSameNameQw); if (!CollectionUtils.isEmpty(portfoliosSameName)) { throw new BusinessException("The title of the published work has been used."); } - AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder(); if (file != null && file.getOriginalFilename() != null) { String upload = minioUtil.upload("aida-canvas", String.valueOf(authPrincipalVo.getId()), file); Canvas canvas = new Canvas(); @@ -128,11 +138,17 @@ public class PortfolioServiceImpl extends ServiceImpl designQueryWrapper = new QueryWrapper<>(); + designQueryWrapper.lambda().eq(Design::getCollectionId, collectionIdOld); + Design designOld = designMapper.selectOne(designQueryWrapper); Collection collectionOld = collectionMapper.selectById(collectionIdOld); List collectionElementListOld = collectionElementService.getByCollectionId(collectionIdOld); collectionOld.setId(null); collectionMapper.insert(collectionOld); Long collectionIdNew = collectionOld.getId(); + designOld.setCollectionId(collectionIdNew); + designOld.setId(null); + designMapper.insert(designOld); userLikeGroupNew.setCollectionId(collectionIdNew); userLikeGroupMapper.insert(userLikeGroupNew); for (CollectionElement element : collectionElementListOld) { @@ -179,17 +195,12 @@ public class PortfolioServiceImpl extends ServiceImpl userLikeList = userLikeService.getUserLikeList(portfolioDTO.getUserLikeGroupId()); -// Long coverIdNew = null; -// Boolean flag = false; for (UserLike userLike : userLikeList) { Long designOutfitIdOld = userLike.getDesignOutfitId(); TDesignPythonOutfit designPythonOutfit = designPythonOutfitMapper.selectById(designOutfitIdOld); designPythonOutfit.setDesignId(-1L); designPythonOutfit.setDesignItemId(-1L); designPythonOutfit.setCollectionId(collectionIdNew); -// if (designPythonOutfit.getId().equals(coverIdOld)) { -// flag = true; -// } designPythonOutfit.setId(null); Long designItemIdOld = userLike.getDesignItemId(); DesignItem designItemOld = designItemMapper.selectById(designItemIdOld); @@ -208,21 +219,12 @@ public class PortfolioServiceImpl extends ServiceImpl tDesignPythonOutfitDetails = designPythonOutfitDetailMapper.selectList(qw); for (TDesignPythonOutfitDetail tDesignPythonOutfitDetail : tDesignPythonOutfitDetails) { -// Long designPythonOutfitDetailIdOld = tDesignPythonOutfitDetail.getId(); tDesignPythonOutfitDetail.setId(null); tDesignPythonOutfitDetail.setDesignId(-1L); tDesignPythonOutfitDetail.setDesignPythonOutfitId(designOutfitIdNew); designPythonOutfitDetailMapper.insert(tDesignPythonOutfitDetail); } -// if (flag) { -// coverIdNew = designOutfitIdNew; -// portfolio.setCoverId(coverIdNew); -// portfolioMapper.updateById(portfolio); -// flag = false; -// } -// designPythonOutfitMapper.updateById(designPythonOutfit); - userLike.setDesignItemId(designItemIdNew); userLike.setId(null); userLike.setDesignId(-1L); @@ -283,15 +285,16 @@ public class PortfolioServiceImpl extends ServiceImpl existSameNameQw = new QueryWrapper<>(); existSameNameQw.lambda().ne(Portfolio::getId, portfolioDTO.getId()); existSameNameQw.lambda().eq(Portfolio::getPortfolioName, portfolioDTO.getPortfolioName()); + existSameNameQw.lambda().eq(Portfolio::getAccountId, authPrincipalVo.getId()); List portfoliosSameName = portfolioMapper.selectList(existSameNameQw); if (!CollectionUtils.isEmpty(portfoliosSameName)) { throw new BusinessException("The title of the published work has been used."); } if (portfolioDTO.getPortfolioType().equals("History")) { - AuthPrincipalVo authPrincipalVo = UserContext.getUserHolder(); UserLikeGroup userLikeGroup = userLikeGroupMapper.selectById(portfolioDTO.getUserLikeGroupId()); UserLikeGroup userLikeGroupNew = userLikeGroup.setId(null); userLikeGroupNew.setAccountId(-1L); @@ -499,9 +502,9 @@ public class PortfolioServiceImpl extends ServiceImpl collectionElementRelationListNew = new ArrayList<>(); for (CollectionElement element : collectionElementListOld) { @@ -638,34 +641,101 @@ public class PortfolioServiceImpl extends ServiceImpl getAnotherOneQw = new QueryWrapper<>(); - getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models") + getAnotherOneQw.lambda().eq(SysFile::getLevel1Type, "Models"); + getAnotherOneQw.lambda().eq(SysFile::getLevel2Type, "Male"); + if (!StringUtils.isEmpty(sysFile.getLevel3Type())) { + getAnotherOneQw.lambda().eq(SysFile::getLevel3Type, sysFile.getLevel3Type()); + QueryWrapper