From 9e5bafc75e03f948ff1199552ecffc226aca93bf Mon Sep 17 00:00:00 2001 From: shahaibo <1023316923@qq.com> Date: Wed, 23 Apr 2025 14:05:14 +0800 Subject: [PATCH] =?UTF-8?q?TASK:=E6=A8=A1=E5=9D=97=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../da/service/impl/PortfolioServiceImpl.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) 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));