feat(source): 添加缩略图URL字段并优化商品详情展示逻辑

- 在 SourceRespVO 中新增 thumbUrl 字段用于存储缩略图地址- 修改 GoodsServiceImpl 中的商品详情封面图设置逻辑,优先使用缩略图
- 更新 SourceMapper.xml 查询语句,增加 thumb_url 字段的查询支持
This commit is contained in:
2025-10-20 10:20:12 +08:00
parent 8eed685373
commit 8d24e7f9e5
3 changed files with 7 additions and 1 deletions

View File

@@ -33,6 +33,7 @@ public class SourceRespVO {
private Long faceId;
// 原素材类型:1视频,2图像
private Integer type;
private String thumbUrl;
/**
* 文件存储地址
*/

View File

@@ -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());

View File

@@ -241,7 +241,7 @@
limit 1
</select>
<select id="listUser" resultType="com.ycwl.basic.model.pc.source.resp.SourceRespVO">
select so.id, ms.scenic_id, device_id, url, ms.is_free, so.create_time, so.update_time, ms.is_buy, video_url
select so.id, ms.scenic_id, device_id, thumb_url, url, ms.is_free, so.create_time, so.update_time, ms.is_buy, video_url
from member_source ms
left join source so on ms.source_id = so.id