| | |
| | | import cn.lili.modules.lmk.domain.vo.CollectTypeNumVO; |
| | | import cn.lili.modules.lmk.enums.general.CollectTypeEnum; |
| | | import cn.lili.modules.lmk.service.MyCollectService; |
| | | import cn.lili.modules.lmk.service.ThumbsUpRecordService; |
| | | import cn.lili.modules.lmk.service.VideoCommentService; |
| | | import cn.lili.modules.lmk.service.VideoService; |
| | | import com.xxl.job.core.context.XxlJobHelper; |
| | | import com.xxl.job.core.handler.annotation.XxlJob; |
| | |
| | | |
| | | private final VideoService videoService; |
| | | private final MyCollectService myCollectService; |
| | | private final VideoCommentService videoCommentService; |
| | | private final ThumbsUpRecordService thumbsUpRecordService; |
| | | |
| | | /** |
| | | * 视频收藏数统计 |
| | |
| | | @XxlJob("videoCollectNumJob") |
| | | public void videoCollectNumJob() throws Exception { |
| | | XxlJobHelper.log("开始执行:视频收藏数统计"); |
| | | List<CollectTypeNumVO> numList = myCollectService.countNumGroupByType(CollectTypeEnum.VIDEO.getValue()); |
| | | List<CollectTypeNumVO> numList = myCollectService.countNumGroupByVideo(); |
| | | if (CollectionUtils.isNotEmpty(numList)) { |
| | | videoService.updateCollectNumBatch(numList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 视频评论数统计 |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("videoCommentNumJob") |
| | | public void videoCommentNumJob() throws Exception { |
| | | XxlJobHelper.log("开始执行:视频评论数统计"); |
| | | List<CollectTypeNumVO> numList = videoCommentService.countNumGroupByVideo(); |
| | | if (CollectionUtils.isNotEmpty(numList)) { |
| | | videoService.updateCommentNumBatch(numList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 视频评论点赞数统计 |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("videoCommentThumbsUpNumJob") |
| | | public void videoCommentThumbsUpNumJob() throws Exception { |
| | | XxlJobHelper.log("开始执行:评论点赞数统计"); |
| | | |
| | | List<CollectTypeNumVO> numList = thumbsUpRecordService.countNumGroupByComment(); |
| | | if (CollectionUtils.isNotEmpty(numList)) { |
| | | videoCommentService.updateCommentThumbsUpNumBatch(numList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 视频点赞数统计 |
| | | * |
| | | * @throws Exception |
| | | */ |
| | | @XxlJob("videoThumbsUpNumJob") |
| | | public void videoThumbsUpNumJob() throws Exception { |
| | | XxlJobHelper.log("开始执行:视频点赞数统计"); |
| | | |
| | | List<CollectTypeNumVO> numList = thumbsUpRecordService.countNumGroupByVideo(); |
| | | if (CollectionUtils.isNotEmpty(numList)) { |
| | | videoService.updateThumbsUpNumBatch(numList); |
| | | } |
| | | } |
| | | |
| | | } |