From c1125c45cc9171a1848ef4caa976e77eceea3215 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期三, 02 七月 2025 10:39:34 +0800
Subject: [PATCH] insert 覆盖模式添加购物车
---
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
index 57909e0..116f4f6 100644
--- a/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
+++ b/framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java
@@ -140,6 +140,11 @@
} else if (VideoContentTypeEnum.IMG.getValue().equals(vo.getVideoContentType()) && StringUtils.isNotBlank(vo.getVideoImgs())) {
vo.setImgs(JSON.parseArray(vo.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList()));
}
+ if (CollectionUtils.isNotEmpty(vo.getGoodsList())) {
+ vo.getGoodsList().stream().forEach(goods -> {
+ goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
+ });
+ }
return Result.ok().data(vo);
}
@@ -401,7 +406,11 @@
} else if (VideoContentTypeEnum.IMG.getValue().equals(v.getVideoContentType()) && StringUtils.isNotBlank(v.getVideoImgs())) {
v.setImgs(JSON.parseArray(v.getVideoImgs(), String.class).stream().map(fileKey -> cosUtil.getPreviewUrl(fileKey)).collect(Collectors.toList()));
}
-
+ if (CollectionUtils.isNotEmpty(v.getGoodsList())) {
+ v.getGoodsList().stream().forEach(goods -> {
+ goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
+ });
+ }
v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId()));
});
}
@@ -571,6 +580,9 @@
@Override
public Result getGoodsDetail(String videoId) {
List<VideoGoodsDetailVO> goodsList = baseMapper.getVideoGoods(videoId);
+ goodsList.stream().forEach(goods -> {
+ goods.setThumbnail(cosUtil.getPreviewUrl(goods.getThumbnail()));
+ });
return Result.ok().data(goodsList);
}
@@ -621,7 +633,7 @@
video.setAuthorId(UserContext.getCurrentUserId());
video.setVideoType(VideoTypeEnum.HEALTH.getValue());
//璁剧疆濉厖妯″紡 淇濇寔姣斾緥锛屽畬鏁存樉绀�
- video.setVideoFit("contain");
+ video.setVideoFit(form.getVideoFit());
video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue());
video.setStatus(VideoStatusEnum.PUBLISHED.getValue());
baseMapper.insert(video);
@@ -678,7 +690,7 @@
video.setAuthorId(UserContext.getCurrentUserId());
video.setVideoType(VideoTypeEnum.COOK.getValue());
//璁剧疆濉厖妯″紡 淇濇寔姣斾緥锛屽畬鏁存樉绀�
- video.setVideoFit("contain");
+ video.setVideoFit(form.getVideoFit());
video.setVideoContentType(VideoContentTypeEnum.VIDEO.getValue());
video.setStatus(VideoStatusEnum.PUBLISHED.getValue());
baseMapper.insert(video);
--
Gitblit v1.8.0