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 5c68e7d1..b9676847 100644 --- a/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/PortfolioServiceImpl.java @@ -502,22 +502,25 @@ public class PortfolioServiceImpl extends ServiceImpl collectionElementList = collectionElementService.getByCollectionId(collectionId); - for (CollectionElement element : collectionElementList) { - if (StringUtils.isEmpty(element.getUrl())) { - continue; + if (!StringUtils.isEmpty(portfolio.getSnapshot())) { + ProjectSnapshot projectSnapshot = JSONObject.parseObject(portfolio.getSnapshot(), ProjectSnapshot.class); + List collectionElementList = projectSnapshot.getCollectionElementList(); + for (CollectionElement element : collectionElementList) { + if (StringUtils.isEmpty(element.getUrl())) { + continue; + } + element.setUrl(minioUtil.getPreSignedUrl(element.getUrl(), 24 * 60)); } - element.setUrl(minioUtil.getPreSignedUrl(element.getUrl(), 24 * 60)); + vo.setCollectionElementList(collectionElementList); + List userLikeList = projectSnapshot.getUserLikeList(); + List list = new ArrayList<>(); + for (UserLikeSnapshot userLikeSnapshot : userLikeList) { + TDesignPythonOutfit designPythonOutfit = userLikeSnapshot.getDesignPythonOutfit(); + designPythonOutfit.setDesignUrl(minioUtil.getPreSignedUrl(designPythonOutfit.getDesignUrl(), 24 * 60)); + list.add(designPythonOutfit); + } + vo.setDesignPythonOutfitList(list); } - vo.setCollectionElementList(collectionElementList); - QueryWrapper qw = new QueryWrapper<>(); - qw.lambda().eq(TDesignPythonOutfit::getCollectionId, portfolio.getCollectionId()); - List designPythonOutfitList = designPythonOutfitMapper.selectList(qw); - for (TDesignPythonOutfit tDesignPythonOutfit : designPythonOutfitList) { - tDesignPythonOutfit.setDesignUrl(minioUtil.getPreSignedUrl(tDesignPythonOutfit.getDesignUrl(), 24 * 60)); - } - vo.setDesignPythonOutfitList(designPythonOutfitList); } Canvas canvas = canvasMapper.selectById(vo.getCanvasId()); vo.setCanvasUrl(minioUtil.getPreSignedUrl(canvas.getUrl(), 24 * 60));