From ba524bc13846fcbedb231b4bebc9a1a0927c5f70 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 30 五月 2025 15:44:15 +0800
Subject: [PATCH] 活动用户登录id可用后整理
---
framework/src/main/java/cn/lili/modules/lmk/service/impl/VideoServiceImpl.java | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 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 68137f4..bf978a9 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
@@ -54,6 +54,7 @@
private final MyCollectService myCollectService;
private final COSUtil cosUtil;
private final FootprintService footprintService;
+ private final MySubscribeService mySubscribeService;
/**
* 娣诲姞
@@ -270,12 +271,14 @@
Map<String, List<SimpleMyCollectVO>> collectMap =myCollectService.getCollectsByVideoIds(videoIds)
.stream()
.collect(Collectors.groupingBy(SimpleMyCollectVO::getRefId));
- // 3. 鑾峰彇瑙嗛涓存椂璁块棶鍦板潃銆佽缃棰戞爣绛俱�佹垜鏄惁鏀惰棌
+ List<String> subscribes = mySubscribeService.getSubscribesByUserId(UserContext.getCurrentUserId());
+ // 3. 鑾峰彇瑙嗛涓存椂璁块棶鍦板潃銆佽缃棰戞爣绛俱�佹垜鏄惁鏀惰棌銆佷綔鑰呮槸鍚﹀叧娉�
page.getRecords().forEach(v -> {
v.setGoods(new VideoGoodsVO());
v.setTagList(tagMap.get(v.getId()));
v.setCollected(CollectionUtils.isNotEmpty(collectMap.get(v.getId())));
v.setVideoUrl(cosUtil.getPreviewUrl(v.getVideoFileKey()));
+ v.setSubscribeThisAuthor(subscribes.contains(v.getAuthorId()));
});
}
return Result.ok().data(page.getRecords());
@@ -292,12 +295,23 @@
}
@Override
+ @Transactional(rollbackFor = Exception.class)
+ public void updateCommentNumBatch(List<CollectTypeNumVO> numList) {
+ // 鎸�500鏉℃暟鎹繘琛屾媶鍒�
+ List<List<CollectTypeNumVO>> chunks = ListUtils.partition(numList, 500);
+ for (List<CollectTypeNumVO> chunk : chunks) {
+ baseMapper.updateCommentNumBatch(chunk);
+ }
+ }
+
+ @Override
public Result saveViewRecord(VideoFootPrintForm form) {
FootPrint footPrint = new FootPrint();
footPrint.setViewType(ViewTypeEnum.VIDEO.getValue());
footPrint.setRefId(form.getVideoId());
footPrint.setMemberId(UserContext.getCurrentUserId());
footPrint.setViewDuration(form.getViewDuration());
+ footPrint.setPlayAt(form.getPlayAt());
footprintService.saveFootprint(footPrint);
return Result.ok();
}
--
Gitblit v1.8.0