From 8d24e7f9e51c8dd223ac6893a04b9318b99563c5 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Mon, 20 Oct 2025 10:20:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(source):=20=E6=B7=BB=E5=8A=A0=E7=BC=A9?= =?UTF-8?q?=E7=95=A5=E5=9B=BEURL=E5=AD=97=E6=AE=B5=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=95=86=E5=93=81=E8=AF=A6=E6=83=85=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 SourceRespVO 中新增 thumbUrl 字段用于存储缩略图地址- 修改 GoodsServiceImpl 中的商品详情封面图设置逻辑,优先使用缩略图 - 更新 SourceMapper.xml 查询语句,增加 thumb_url 字段的查询支持 --- .../com/ycwl/basic/model/pc/source/resp/SourceRespVO.java | 1 + .../com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java | 5 +++++ src/main/resources/mapper/SourceMapper.xml | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java b/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java index dc2a6ec0..39732833 100644 --- a/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java +++ b/src/main/java/com/ycwl/basic/model/pc/source/resp/SourceRespVO.java @@ -33,6 +33,7 @@ public class SourceRespVO { private Long faceId; // 原素材类型:1视频,2图像 private Integer type; + private String thumbUrl; /** * 文件存储地址 */ diff --git a/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java b/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java index fe8965b6..d6ef5bd4 100644 --- a/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java +++ b/src/main/java/com/ycwl/basic/service/mobile/impl/GoodsServiceImpl.java @@ -237,6 +237,11 @@ public class GoodsServiceImpl implements GoodsService { } catch (Exception e) { goodsDetailVO.setScenicName(""); } + if (StringUtils.isNotBlank(sourceRespVO.getThumbUrl())) { + goodsDetailVO.setTemplateCoverUrl(sourceRespVO.getThumbUrl()); + } else { + goodsDetailVO.setTemplateCoverUrl(sourceRespVO.getUrl()); + } goodsDetailVO.setGoodsType(sourceType); goodsDetailVO.setFaceId(face.getId()); goodsDetailVO.setGoodsId(sourceRespVO.getId()); diff --git a/src/main/resources/mapper/SourceMapper.xml b/src/main/resources/mapper/SourceMapper.xml index 0cdf3ddb..7d6fc71c 100644 --- a/src/main/resources/mapper/SourceMapper.xml +++ b/src/main/resources/mapper/SourceMapper.xml @@ -241,7 +241,7 @@ limit 1