Pārlūkot izejas kodu

Merge branch '20250424-wyp-videoAgg' of Server/growth-manager into master

wangyunpeng 9 stundas atpakaļ
vecāks
revīzija
f93b48b841
19 mainītis faili ar 1726 papildinājumiem un 83 dzēšanām
  1. 0 2
      api-module/src/main/java/com/tzld/piaoquan/api/component/TouLiuHttpClient.java
  2. 4 1
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java
  3. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoAggMapper.java
  4. 11 5
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  5. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java
  6. 118 48
      api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformVideoJob.java
  7. 0 6
      api-module/src/main/java/com/tzld/piaoquan/api/model/bo/VideoDetail.java
  8. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideo.java
  9. 134 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAgg.java
  10. 921 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAggExample.java
  11. 70 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoExample.java
  12. 9 3
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  13. 309 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAggMapper.xml
  14. 23 7
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoMapper.xml
  15. 40 8
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml
  16. 1 0
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml
  17. 6 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/VideoDetail.java
  18. 2 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java
  19. 34 3
      common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/DateUtil.java

+ 0 - 2
api-module/src/main/java/com/tzld/piaoquan/api/component/TouLiuHttpClient.java

@@ -74,8 +74,6 @@ public class TouLiuHttpClient {
                 videoDetail.setId(videoId);
                 videoDetail.setCover(shareImgPath);
                 videoDetail.setTitle(title);
-                videoDetail.setAuditStatus(jsonObject.getInteger("auditStatus"));
-                videoDetail.setRecommendStatus(jsonObject.getInteger("recommendStatus"));
                 map.put(videoId, videoDetail);
             }
         } catch (Exception e) {

+ 4 - 1
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.api.controller.contentplatform;
 
+import com.tzld.piaoquan.api.annotation.JwtIgnore;
 import com.tzld.piaoquan.api.job.ContentPlatformVideoJob;
 import com.tzld.piaoquan.api.model.param.IdParam;
 import com.tzld.piaoquan.api.model.param.contentplatform.*;
@@ -89,7 +90,8 @@ public class ContentPlatformPlanController {
         return CommonResponse.success(planService.getSharePic(pageUrl));
     }
 
-    @ApiOperation(value = "同步每日top1000视频")
+    @ApiOperation(value = "同步最近14日top1000视频")
+    @JwtIgnore
     @PostMapping("/syncContentPlatformVideoJob")
     public CommonResponse<Void> syncContentPlatformVideoJob(@RequestBody QwPlanSaveParam param) {
         videoJob.syncContentPlatformVideoJob(null);
@@ -97,6 +99,7 @@ public class ContentPlatformPlanController {
     }
 
     @ApiOperation(value = "检查视频状态")
+    @JwtIgnore
     @PostMapping("/checkContentPlatformVideoStatusJob")
     public CommonResponse<Void> checkContentPlatformVideoStatusJob(@RequestBody QwPlanSaveParam param) {
         videoJob.checkContentPlatformVideoStatusJob(null);

+ 30 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoAggMapper.java

@@ -0,0 +1,30 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform;
+
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAggExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ContentPlatformVideoAggMapper {
+    long countByExample(ContentPlatformVideoAggExample example);
+
+    int deleteByExample(ContentPlatformVideoAggExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ContentPlatformVideoAgg record);
+
+    int insertSelective(ContentPlatformVideoAgg record);
+
+    List<ContentPlatformVideoAgg> selectByExample(ContentPlatformVideoAggExample example);
+
+    ContentPlatformVideoAgg selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") ContentPlatformVideoAgg record, @Param("example") ContentPlatformVideoAggExample example);
+
+    int updateByExample(@Param("record") ContentPlatformVideoAgg record, @Param("example") ContentPlatformVideoAggExample example);
+
+    int updateByPrimaryKeySelective(ContentPlatformVideoAgg record);
+
+    int updateByPrimaryKey(ContentPlatformVideoAgg record);
+}

+ 11 - 5
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java

@@ -3,10 +3,7 @@ package com.tzld.piaoquan.api.dao.mapper.contentplatform.ext;
 import com.tzld.piaoquan.api.model.param.contentplatform.GzhPlanListParam;
 import com.tzld.piaoquan.api.model.param.contentplatform.QwPlanListParam;
 import com.tzld.piaoquan.api.model.param.contentplatform.VideoContentListParam;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlan;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
+import com.tzld.piaoquan.api.model.po.contentplatform.*;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -30,17 +27,21 @@ public interface ContentPlatformPlanMapperExt {
 
     String getVideoMaxDt();
 
-    int getVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt);
+    int getVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt,
+                      @Param("minScore") Double minScore);
 
     List<String> getVideoCategoryList(@Param("dt") String dt);
 
     List<ContentPlatformVideo> getVideoList(@Param("param") VideoContentListParam param,
                                             @Param("dt") String dt,
+                                            @Param("minScore") Double minScore,
                                             @Param("offset") int offset,
                                             @Param("pageSize") Integer pageSize);
 
     void batchInsertContentPlatformVideo(@Param("records") List<ContentPlatformVideo> saveList);
 
+    void batchInsertContentPlatformVideoAgg(@Param("records") List<ContentPlatformVideoAgg> saveList);
+
     int getQwPlanCount(@Param("param") QwPlanListParam param,
                        @Param("createAccountId") Long createAccountId);
 
@@ -48,6 +49,7 @@ public interface ContentPlatformPlanMapperExt {
                                               @Param("createAccountId") Long createAccountId,
                                               @Param("offset") int offset,
                                               @Param("pageSize") Integer pageSize);
+
     void batchInsertQwPlan(@Param("records") List<ContentPlatformQwPlan> saveList);
 
     void insertQwPlanReturnId(@Param("record") ContentPlatformQwPlan qwPlan);
@@ -55,4 +57,8 @@ public interface ContentPlatformPlanMapperExt {
     List<ContentPlatformGzhPlanVideo> getGzhPlanVideoListByCooperateAccountId(@Param("ghId") String ghId);
 
     void updateVideoStatus(@Param("videoId") Long videoId, @Param("now") Long now);
+
+    void updateVideoAggStatus(@Param("videoId") Long videoId, @Param("now") Long now);
+
+    List<ContentPlatformVideoAgg> getVideoAggList(List<String> dtList);
 }

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java

@@ -106,6 +106,9 @@ public class ContentPlatformDatastatJob {
                     item.setFansIncreaseCount(wxAccountDatastatVO.getFansIncreaseCount());
                 }
                 List<Long> planIdList = gzhPlanMap.get(gzhAccount.getId());
+                if (CollectionUtils.isEmpty(planIdList)) {
+                    continue;
+                }
                 Double score = 0.0;
                 int size = 0;
                 for (Long planId : planIdList) {

+ 118 - 48
api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformVideoJob.java

@@ -2,12 +2,15 @@ package com.tzld.piaoquan.api.job;
 
 import com.aliyun.odps.data.Record;
 import com.google.common.collect.Lists;
-import com.tzld.piaoquan.api.component.TouLiuHttpClient;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoAggMapper;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoMapper;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
-import com.tzld.piaoquan.api.model.bo.VideoDetail;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAggExample;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample;
+import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
+import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.OdpsUtil;
 import com.xxl.job.core.biz.model.ReturnT;
@@ -17,10 +20,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 import java.util.stream.Collectors;
 
 @Slf4j
@@ -34,74 +34,144 @@ public class ContentPlatformVideoJob {
     private ContentPlatformVideoMapper videoMapper;
 
     @Autowired
-    private TouLiuHttpClient touLiuHttpClient;
+    private ContentPlatformVideoAggMapper videoAggMapper;
+
+    @Autowired
+    private MessageAttachmentService messageAttachmentService;
 
     @XxlJob("syncContentPlatformVideoJob")
     public ReturnT<String> syncContentPlatformVideoJob(String param) {
-        String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
-        long videoCount = getVideoCount(dt);
-        if (videoCount > 0) {
+        String aggDt = DateUtil.getBeforeDayDateString("yyyyMMdd");
+        List<String> dtList = DateUtil.getBeforeDays(14);
+        // 轮询查询大数据获取最近14天视频
+        for (String dt : dtList) {
+            long videoCount = getVideoCount(dt);
+            if (videoCount > 0) {
+                continue;
+            }
+            String sql = String.format("SELECT * FROM loghubods.wecom_cooperation_video_candidate_pool WHERE dt=%s;", dt);
+            List<Record> dataList = OdpsUtil.getOdpsData(sql);
+            Long now = System.currentTimeMillis();
+            if (CollectionUtils.isNotEmpty(dataList)) {
+                List<ContentPlatformVideo> saveList = new ArrayList<>();
+                for (Record record : dataList) {
+                    ContentPlatformVideo item = new ContentPlatformVideo();
+                    Long videoId = Long.parseLong((String) record.get(0));
+                    String category = (String) record.get(1);
+                    String title = (String) record.get(2);
+                    String videoUrl = (String) record.get(3);
+                    Double score = Double.parseDouble((String) record.get(4));
+                    item.setDt(dt);
+                    item.setVideoId(videoId);
+                    item.setCategory(category);
+                    item.setTitle(title);
+                    item.setVideo(videoUrl);
+                    item.setScore(score);
+                    item.setCreateTimestamp(now);
+                    saveList.add(item);
+                }
+                // 获取视频封面
+                for (List<ContentPlatformVideo> partition : Lists.partition(saveList, 20)) {
+                    List<Long> videoIds = partition.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
+                    Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+                    for (ContentPlatformVideo item : partition) {
+                        VideoDetail detail = coverMap.get(item.getVideoId());
+                        if (Objects.nonNull(detail)) {
+                            String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
+                            item.setCover(cover);
+                            if (detail.getAuditStatus() != 5 || detail.getRecommendStatus() != -6) {
+                                item.setStatus(0);
+                            }
+                        }
+                    }
+                }
+                // save
+                if (CollectionUtils.isNotEmpty(saveList)) {
+                    planMapperExt.batchInsertContentPlatformVideo(saveList);
+                }
+            }
+        }
+        // 更新封面
+        List<ContentPlatformVideo> nullCoverVideoList = getVideoNullCover();
+        if (CollectionUtils.isNotEmpty(nullCoverVideoList)) {
+            for (List<ContentPlatformVideo> partition : Lists.partition(nullCoverVideoList, 20)) {
+                List<Long> videoIds = partition.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
+                Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+                for (ContentPlatformVideo item : partition) {
+                    VideoDetail detail = coverMap.get(item.getVideoId());
+                    if (Objects.isNull(detail)) {
+                        continue;
+                    }
+                    String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
+                    item.setCover(cover);
+                    if (detail.getAuditStatus() != 5 || detail.getRecommendStatus() != -6) {
+                        item.setStatus(0);
+                    }
+                    videoMapper.updateByPrimaryKeySelective(item);
+                }
+            }
+        }
+        long videoAggCount = getVideoAggCount(aggDt);
+        if (videoAggCount > 0) {
             return ReturnT.SUCCESS;
         }
-        String sql = String.format("SELECT * FROM loghubods.wecom_cooperation_video_candidate_pool WHERE dt=%s;", dt);
-        List<Record> dataList = OdpsUtil.getOdpsData(sql);
-        Long now = System.currentTimeMillis();
-        if (CollectionUtils.isNotEmpty(dataList)) {
-            List<ContentPlatformVideo> saveList = new ArrayList<>();
-            for (Record record : dataList) {
-                ContentPlatformVideo item = new ContentPlatformVideo();
-                Long videoId = Long.parseLong((String) record.get(0));
-                String category = (String) record.get(1);
-                String title = (String) record.get(2);
-                String videoUrl = (String) record.get(3);
-                Double score = Double.parseDouble((String) record.get(4));
-                item.setDt(dt);
-                item.setVideoId(videoId);
-                item.setCategory(category);
-                item.setTitle(title);
-                item.setVideo(videoUrl);
-                item.setScore(score);
+        // 聚合最近14天视频
+        List<ContentPlatformVideoAgg> saveAggList = planMapperExt.getVideoAggList(dtList);
+        if (CollectionUtils.isNotEmpty(saveAggList)) {
+            Long now = System.currentTimeMillis();
+            for (ContentPlatformVideoAgg item : saveAggList) {
+                item.setDt(aggDt);
                 item.setCreateTimestamp(now);
-                saveList.add(item);
-            }
-            if (CollectionUtils.isNotEmpty(saveList)) {
-                planMapperExt.batchInsertContentPlatformVideo(saveList);
             }
+            planMapperExt.batchInsertContentPlatformVideoAgg(saveAggList);
         }
         return ReturnT.SUCCESS;
     }
 
+    private List<ContentPlatformVideo> getVideoNullCover() {
+        ContentPlatformVideoExample example = new ContentPlatformVideoExample();
+        example.createCriteria().andCoverIsNull();
+        return videoMapper.selectByExample(example);
+    }
+
     private long getVideoCount(String dt) {
         ContentPlatformVideoExample example = new ContentPlatformVideoExample();
         example.createCriteria().andDtEqualTo(dt);
         return videoMapper.countByExample(example);
     }
+
+    private long getVideoAggCount(String dt) {
+        ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
+        example.createCriteria().andDtEqualTo(dt);
+        return videoAggMapper.countByExample(example);
+    }
+
     @XxlJob("checkContentPlatformVideoStatusJob")
     public ReturnT<String> checkContentPlatformVideoStatusJob(String param) {
         String dt = planMapperExt.getVideoMaxDt();
-        List<ContentPlatformVideo> videoList = getVideoListByDt(dt);
+        List<ContentPlatformVideoAgg> videoList = getVideoListByDt(dt);
         Long now = System.currentTimeMillis();
-        List<Long> videoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
-        Map<Long, VideoDetail> videoDetailMap = new HashMap<>();
-        for (List<Long> partitionVideoIds : Lists.partition(videoIds, 20)) {
-            videoDetailMap.putAll(touLiuHttpClient.getVideoDetailRequest(partitionVideoIds));
-        }
-        for (ContentPlatformVideo video : videoList) {
-            VideoDetail videoDetail = videoDetailMap.get(video.getVideoId());
-            if (videoDetail == null) {
-                continue;
-            }
-            if (videoDetail.getAuditStatus() != 5 || videoDetail.getRecommendStatus() != -6) {
-                planMapperExt.updateVideoStatus(video.getVideoId(), now);
+        for (List<ContentPlatformVideoAgg> partition : Lists.partition(videoList, 20)) {
+            List<Long> videoIds = partition.stream().map(ContentPlatformVideoAgg::getVideoId).collect(Collectors.toList());
+            Map<Long, VideoDetail> videoDetailMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+            for (ContentPlatformVideoAgg video : partition) {
+                VideoDetail videoDetail = videoDetailMap.get(video.getVideoId());
+                if (videoDetail == null) {
+                    continue;
+                }
+                if (videoDetail.getAuditStatus() != 5 || videoDetail.getRecommendStatus() != -6) {
+                    planMapperExt.updateVideoStatus(video.getVideoId(), now);
+                    planMapperExt.updateVideoAggStatus(video.getVideoId(), now);
+                }
             }
         }
         return ReturnT.SUCCESS;
     }
 
-    private List<ContentPlatformVideo> getVideoListByDt(String dt) {
-        ContentPlatformVideoExample example = new ContentPlatformVideoExample();
+    private List<ContentPlatformVideoAgg> getVideoListByDt(String dt) {
+        ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
         example.createCriteria().andDtEqualTo(dt).andStatusEqualTo(1);
-        return videoMapper.selectByExample(example);
+        return videoAggMapper.selectByExample(example);
     }
 
 }

+ 0 - 6
api-module/src/main/java/com/tzld/piaoquan/api/model/bo/VideoDetail.java

@@ -10,10 +10,4 @@ public class VideoDetail {
     private String cover;
 
     private String title;
-
-    // 审核状态  1 审核中,2 不通过 3 待修改,4 自己可见 5 通过
-    private Integer auditStatus;
-
-    // 推荐状态(0:不可搜,-6:待推荐,1:普通推荐,10:编辑推荐,-7:可搜索)
-    private Integer recommendStatus;
 }

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideo.java

@@ -11,6 +11,8 @@ public class ContentPlatformVideo {
 
     private String title;
 
+    private String cover;
+
     private String video;
 
     private Double score;
@@ -61,6 +63,14 @@ public class ContentPlatformVideo {
         this.title = title;
     }
 
+    public String getCover() {
+        return cover;
+    }
+
+    public void setCover(String cover) {
+        this.cover = cover;
+    }
+
     public String getVideo() {
         return video;
     }
@@ -112,6 +122,7 @@ public class ContentPlatformVideo {
         sb.append(", videoId=").append(videoId);
         sb.append(", category=").append(category);
         sb.append(", title=").append(title);
+        sb.append(", cover=").append(cover);
         sb.append(", video=").append(video);
         sb.append(", score=").append(score);
         sb.append(", status=").append(status);

+ 134 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAgg.java

@@ -0,0 +1,134 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideoAgg {
+    private Long id;
+
+    private String dt;
+
+    private Long videoId;
+
+    private String category;
+
+    private String title;
+
+    private String cover;
+
+    private String video;
+
+    private Double score;
+
+    private Integer status;
+
+    private Long createTimestamp;
+
+    private Long updateTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDt() {
+        return dt;
+    }
+
+    public void setDt(String dt) {
+        this.dt = dt;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getCover() {
+        return cover;
+    }
+
+    public void setCover(String cover) {
+        this.cover = cover;
+    }
+
+    public String getVideo() {
+        return video;
+    }
+
+    public void setVideo(String video) {
+        this.video = video;
+    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    public Long getUpdateTimestamp() {
+        return updateTimestamp;
+    }
+
+    public void setUpdateTimestamp(Long updateTimestamp) {
+        this.updateTimestamp = updateTimestamp;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", dt=").append(dt);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", category=").append(category);
+        sb.append(", title=").append(title);
+        sb.append(", cover=").append(cover);
+        sb.append(", video=").append(video);
+        sb.append(", score=").append(score);
+        sb.append(", status=").append(status);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append(", updateTimestamp=").append(updateTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 921 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAggExample.java

@@ -0,0 +1,921 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformVideoAggExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoAggExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNull() {
+            addCriterion("dt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNotNull() {
+            addCriterion("dt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtEqualTo(String value) {
+            addCriterion("dt =", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotEqualTo(String value) {
+            addCriterion("dt <>", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThan(String value) {
+            addCriterion("dt >", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThanOrEqualTo(String value) {
+            addCriterion("dt >=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThan(String value) {
+            addCriterion("dt <", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThanOrEqualTo(String value) {
+            addCriterion("dt <=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLike(String value) {
+            addCriterion("dt like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotLike(String value) {
+            addCriterion("dt not like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIn(List<String> values) {
+            addCriterion("dt in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotIn(List<String> values) {
+            addCriterion("dt not in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtBetween(String value1, String value2) {
+            addCriterion("dt between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotBetween(String value1, String value2) {
+            addCriterion("dt not between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryIsNull() {
+            addCriterion("category is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryIsNotNull() {
+            addCriterion("category is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryEqualTo(String value) {
+            addCriterion("category =", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotEqualTo(String value) {
+            addCriterion("category <>", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryGreaterThan(String value) {
+            addCriterion("category >", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryGreaterThanOrEqualTo(String value) {
+            addCriterion("category >=", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryLessThan(String value) {
+            addCriterion("category <", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryLessThanOrEqualTo(String value) {
+            addCriterion("category <=", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryLike(String value) {
+            addCriterion("category like", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotLike(String value) {
+            addCriterion("category not like", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryIn(List<String> values) {
+            addCriterion("category in", values, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotIn(List<String> values) {
+            addCriterion("category not in", values, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryBetween(String value1, String value2) {
+            addCriterion("category between", value1, value2, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotBetween(String value1, String value2) {
+            addCriterion("category not between", value1, value2, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNull() {
+            addCriterion("title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNotNull() {
+            addCriterion("title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleEqualTo(String value) {
+            addCriterion("title =", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotEqualTo(String value) {
+            addCriterion("title <>", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThan(String value) {
+            addCriterion("title >", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("title >=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThan(String value) {
+            addCriterion("title <", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThanOrEqualTo(String value) {
+            addCriterion("title <=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLike(String value) {
+            addCriterion("title like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotLike(String value) {
+            addCriterion("title not like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIn(List<String> values) {
+            addCriterion("title in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotIn(List<String> values) {
+            addCriterion("title not in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleBetween(String value1, String value2) {
+            addCriterion("title between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotBetween(String value1, String value2) {
+            addCriterion("title not between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverIsNull() {
+            addCriterion("cover is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverIsNotNull() {
+            addCriterion("cover is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverEqualTo(String value) {
+            addCriterion("cover =", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotEqualTo(String value) {
+            addCriterion("cover <>", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverGreaterThan(String value) {
+            addCriterion("cover >", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverGreaterThanOrEqualTo(String value) {
+            addCriterion("cover >=", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverLessThan(String value) {
+            addCriterion("cover <", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverLessThanOrEqualTo(String value) {
+            addCriterion("cover <=", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverLike(String value) {
+            addCriterion("cover like", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotLike(String value) {
+            addCriterion("cover not like", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverIn(List<String> values) {
+            addCriterion("cover in", values, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotIn(List<String> values) {
+            addCriterion("cover not in", values, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverBetween(String value1, String value2) {
+            addCriterion("cover between", value1, value2, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotBetween(String value1, String value2) {
+            addCriterion("cover not between", value1, value2, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIsNull() {
+            addCriterion("video is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIsNotNull() {
+            addCriterion("video is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoEqualTo(String value) {
+            addCriterion("video =", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotEqualTo(String value) {
+            addCriterion("video <>", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoGreaterThan(String value) {
+            addCriterion("video >", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoGreaterThanOrEqualTo(String value) {
+            addCriterion("video >=", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoLessThan(String value) {
+            addCriterion("video <", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoLessThanOrEqualTo(String value) {
+            addCriterion("video <=", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoLike(String value) {
+            addCriterion("video like", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotLike(String value) {
+            addCriterion("video not like", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIn(List<String> values) {
+            addCriterion("video in", values, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotIn(List<String> values) {
+            addCriterion("video not in", values, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoBetween(String value1, String value2) {
+            addCriterion("video between", value1, value2, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotBetween(String value1, String value2) {
+            addCriterion("video not between", value1, value2, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNull() {
+            addCriterion("score is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNotNull() {
+            addCriterion("score is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreEqualTo(Double value) {
+            addCriterion("score =", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotEqualTo(Double value) {
+            addCriterion("score <>", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThan(Double value) {
+            addCriterion("score >", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("score >=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThan(Double value) {
+            addCriterion("score <", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThanOrEqualTo(Double value) {
+            addCriterion("score <=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIn(List<Double> values) {
+            addCriterion("score in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotIn(List<Double> values) {
+            addCriterion("score not in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreBetween(Double value1, Double value2) {
+            addCriterion("score between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotBetween(Double value1, Double value2) {
+            addCriterion("score not between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampIsNull() {
+            addCriterion("update_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampIsNotNull() {
+            addCriterion("update_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampEqualTo(Long value) {
+            addCriterion("update_timestamp =", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampNotEqualTo(Long value) {
+            addCriterion("update_timestamp <>", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampGreaterThan(Long value) {
+            addCriterion("update_timestamp >", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("update_timestamp >=", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampLessThan(Long value) {
+            addCriterion("update_timestamp <", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("update_timestamp <=", value, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampIn(List<Long> values) {
+            addCriterion("update_timestamp in", values, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampNotIn(List<Long> values) {
+            addCriterion("update_timestamp not in", values, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampBetween(Long value1, Long value2) {
+            addCriterion("update_timestamp between", value1, value2, "updateTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("update_timestamp not between", value1, value2, "updateTimestamp");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 70 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoExample.java

@@ -445,6 +445,76 @@ public class ContentPlatformVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andCoverIsNull() {
+            addCriterion("cover is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverIsNotNull() {
+            addCriterion("cover is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverEqualTo(String value) {
+            addCriterion("cover =", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotEqualTo(String value) {
+            addCriterion("cover <>", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverGreaterThan(String value) {
+            addCriterion("cover >", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverGreaterThanOrEqualTo(String value) {
+            addCriterion("cover >=", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverLessThan(String value) {
+            addCriterion("cover <", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverLessThanOrEqualTo(String value) {
+            addCriterion("cover <=", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverLike(String value) {
+            addCriterion("cover like", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotLike(String value) {
+            addCriterion("cover not like", value, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverIn(List<String> values) {
+            addCriterion("cover in", values, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotIn(List<String> values) {
+            addCriterion("cover not in", values, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverBetween(String value1, String value2) {
+            addCriterion("cover between", value1, value2, "cover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCoverNotBetween(String value1, String value2) {
+            addCriterion("cover not between", value1, value2, "cover");
+            return (Criteria) this;
+        }
+
         public Criteria andVideoIsNull() {
             addCriterion("video is null");
             return (Criteria) this;

+ 9 - 3
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -88,6 +88,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Value("${vlog.share.appType:11}")
     private String shareAppType;
 
+    @Value("${video.min.score:0.6}")
+    private Double videoMinScore;
+
     @Override
     public Page<GzhPlanItemVO> gzhPlanList(GzhPlanListParam param) {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
@@ -355,12 +358,12 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         Page<VideoContentItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
         int offset = (param.getPageNum() - 1) * param.getPageSize();
         String dt = planMapperExt.getVideoMaxDt();
-        int count = planMapperExt.getVideoCount(param, dt);
+        int count = planMapperExt.getVideoCount(param, dt, videoMinScore);
         result.setTotalSize(count);
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, offset, param.getPageSize());
+        List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, videoMinScore, offset, param.getPageSize());
         List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList);
         result.setObjs(list);
         return result;
@@ -370,7 +373,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         if (CollectionUtils.isEmpty(videoList)) {
             return null;
         }
-        List<Long> videoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
+        List<Long> videoIds = videoList.stream()
+                .filter(o -> !StringUtils.hasText(o.getCover()))
+                .map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
         Map<Long, VideoDetail> coverMap = new HashMap<>();
         for (List<Long> partition : Lists.partition(videoIds, 20)) {
             Set<Long> ids = new HashSet<>(partition);
@@ -381,6 +386,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             VideoContentItemVO item = new VideoContentItemVO();
             item.setVideoId(video.getVideoId());
             item.setTitle(video.getTitle());
+            item.setCover(video.getCover());
             VideoDetail detail = coverMap.get(video.getVideoId());
             if (Objects.nonNull(detail)) {
                 String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));

+ 309 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAggMapper.xml

@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoAggMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="category" jdbcType="VARCHAR" property="category" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="cover" jdbcType="VARCHAR" property="cover" />
+    <result column="video" jdbcType="VARCHAR" property="video" />
+    <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+    <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, dt, video_id, category, title, cover, video, score, `status`, create_timestamp, 
+    update_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAggExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video_agg
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from content_platform_video_agg
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video_agg
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAggExample">
+    delete from content_platform_video_agg
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
+    insert into content_platform_video_agg (id, dt, video_id, 
+      category, title, cover, 
+      video, score, `status`, 
+      create_timestamp, update_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
+      #{category,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
+      #{video,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
+    insert into content_platform_video_agg
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dt != null">
+        dt,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="category != null">
+        category,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="cover != null">
+        cover,
+      </if>
+      <if test="video != null">
+        video,
+      </if>
+      <if test="score != null">
+        score,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+      <if test="updateTimestamp != null">
+        update_timestamp,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="dt != null">
+        #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="category != null">
+        #{category,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="cover != null">
+        #{cover,jdbcType=VARCHAR},
+      </if>
+      <if test="video != null">
+        #{video,jdbcType=VARCHAR},
+      </if>
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="updateTimestamp != null">
+        #{updateTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAggExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video_agg
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video_agg
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.dt != null">
+        dt = #{record.dt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.category != null">
+        category = #{record.category,jdbcType=VARCHAR},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.cover != null">
+        cover = #{record.cover,jdbcType=VARCHAR},
+      </if>
+      <if test="record.video != null">
+        video = #{record.video,jdbcType=VARCHAR},
+      </if>
+      <if test="record.score != null">
+        score = #{record.score,jdbcType=DOUBLE},
+      </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="record.updateTimestamp != null">
+        update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_video_agg
+    set id = #{record.id,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      category = #{record.category,jdbcType=VARCHAR},
+      title = #{record.title,jdbcType=VARCHAR},
+      cover = #{record.cover,jdbcType=VARCHAR},
+      video = #{record.video,jdbcType=VARCHAR},
+      score = #{record.score,jdbcType=DOUBLE},
+      `status` = #{record.status,jdbcType=INTEGER},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
+    update content_platform_video_agg
+    <set>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="category != null">
+        category = #{category,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="cover != null">
+        cover = #{cover,jdbcType=VARCHAR},
+      </if>
+      <if test="video != null">
+        video = #{video,jdbcType=VARCHAR},
+      </if>
+      <if test="score != null">
+        score = #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="updateTimestamp != null">
+        update_timestamp = #{updateTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
+    update content_platform_video_agg
+    set dt = #{dt,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      category = #{category,jdbcType=VARCHAR},
+      title = #{title,jdbcType=VARCHAR},
+      cover = #{cover,jdbcType=VARCHAR},
+      video = #{video,jdbcType=VARCHAR},
+      score = #{score,jdbcType=DOUBLE},
+      `status` = #{status,jdbcType=INTEGER},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      update_timestamp = #{updateTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 23 - 7
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoMapper.xml

@@ -7,6 +7,7 @@
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="category" jdbcType="VARCHAR" property="category" />
     <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="cover" jdbcType="VARCHAR" property="cover" />
     <result column="video" jdbcType="VARCHAR" property="video" />
     <result column="score" jdbcType="DOUBLE" property="score" />
     <result column="status" jdbcType="INTEGER" property="status" />
@@ -72,7 +73,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, dt, video_id, category, title, video, score, `status`, create_timestamp, update_timestamp
+    id, dt, video_id, category, title, cover, video, score, `status`, create_timestamp, 
+    update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample" resultMap="BaseResultMap">
     select
@@ -109,13 +111,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
     insert into content_platform_video (id, dt, video_id, 
-      category, title, video, 
-      score, `status`, create_timestamp, 
-      update_timestamp)
+      category, title, cover, 
+      video, score, `status`, 
+      create_timestamp, update_timestamp)
     values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
-      #{category,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
-      #{score,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}, 
-      #{updateTimestamp,jdbcType=BIGINT})
+      #{category,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
+      #{video,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, 
+      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
     insert into content_platform_video
@@ -135,6 +137,9 @@
       <if test="title != null">
         title,
       </if>
+      <if test="cover != null">
+        cover,
+      </if>
       <if test="video != null">
         video,
       </if>
@@ -167,6 +172,9 @@
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
       </if>
+      <if test="cover != null">
+        #{cover,jdbcType=VARCHAR},
+      </if>
       <if test="video != null">
         #{video,jdbcType=VARCHAR},
       </if>
@@ -208,6 +216,9 @@
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
       </if>
+      <if test="record.cover != null">
+        cover = #{record.cover,jdbcType=VARCHAR},
+      </if>
       <if test="record.video != null">
         video = #{record.video,jdbcType=VARCHAR},
       </if>
@@ -235,6 +246,7 @@
       video_id = #{record.videoId,jdbcType=BIGINT},
       category = #{record.category,jdbcType=VARCHAR},
       title = #{record.title,jdbcType=VARCHAR},
+      cover = #{record.cover,jdbcType=VARCHAR},
       video = #{record.video,jdbcType=VARCHAR},
       score = #{record.score,jdbcType=DOUBLE},
       `status` = #{record.status,jdbcType=INTEGER},
@@ -259,6 +271,9 @@
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
       </if>
+      <if test="cover != null">
+        cover = #{cover,jdbcType=VARCHAR},
+      </if>
       <if test="video != null">
         video = #{video,jdbcType=VARCHAR},
       </if>
@@ -283,6 +298,7 @@
       video_id = #{videoId,jdbcType=BIGINT},
       category = #{category,jdbcType=VARCHAR},
       title = #{title,jdbcType=VARCHAR},
+      cover = #{cover,jdbcType=VARCHAR},
       video = #{video,jdbcType=VARCHAR},
       score = #{score,jdbcType=DOUBLE},
       `status` = #{status,jdbcType=INTEGER},

+ 40 - 8
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -75,13 +75,13 @@
 
     <select id="getVideoMaxDt" resultType="java.lang.String">
         select max(dt)
-        from content_platform_video
+        from content_platform_video_agg
     </select>
 
     <select id="getVideoCount" resultType="java.lang.Integer">
         select count(1)
-        from content_platform_video
-        where dt = #{dt} and status = 1
+        from content_platform_video_agg
+        where dt = #{dt} and status = 1 and score > #{minScore}
         <if test="param.title!= null and param.title!= ''">
             and title like concat('%', #{param.title}, '%')
         </if>
@@ -92,8 +92,8 @@
 
     <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
         select *
-        from content_platform_video
-        where dt = #{dt} and status = 1
+        from content_platform_video_agg
+        where dt = #{dt} and status = 1 and score > #{minScore}
         <if test="param.title!= null and param.title!= ''">
             and title like concat('%', #{param.title}, '%')
         </if>
@@ -106,15 +106,24 @@
 
     <select id="getVideoCategoryList" resultType="java.lang.String">
         select distinct category
-        from content_platform_video
+        from content_platform_video_agg
         where dt = #{dt} and status = 1
     </select>
 
     <insert id="batchInsertContentPlatformVideo">
-        insert into content_platform_video (dt, video_id, category, title, video, score, create_timestamp)
+        insert into content_platform_video (dt, video_id, category, title, cover, video, score, create_timestamp)
         values
         <foreach collection="records" item="item" separator=",">
-            (#{item.dt}, #{item.videoId}, #{item.category}, #{item.title}, #{item.video}, #{item.score},
+            (#{item.dt}, #{item.videoId}, #{item.category}, #{item.title}, #{item.cover}, #{item.video}, #{item.score},
+            #{item.createTimestamp})
+        </foreach>
+    </insert>
+
+    <insert id="batchInsertContentPlatformVideoAgg">
+        insert into content_platform_video_agg (dt, video_id, category, title, cover, video, score, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dt}, #{item.videoId}, #{item.category}, #{item.title}, #{item.cover}, #{item.video}, #{item.score},
             #{item.createTimestamp})
         </foreach>
     </insert>
@@ -183,6 +192,22 @@
           and cpgp.status = 1
     </select>
 
+    <select id="getVideoAggList"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
+        SELECT t.video_id, t.category, t.title, t.cover, t.video, round(t.avg_score, 3) as score
+        FROM (
+        SELECT video_id, category, title, cover, video, AVG(score) OVER (PARTITION BY video_id) AS avg_score,
+            ROW_NUMBER() OVER (PARTITION BY video_id ORDER BY dt DESC) AS rn
+        FROM content_platform_video
+        where dt in
+        <foreach collection="dtList" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        and status = 1
+        ) AS t
+        WHERE t.rn = 1;
+    </select>
+
     <update id="updateVideoStatus">
         update content_platform_video
         set status = 0,
@@ -190,4 +215,11 @@
         where video_id = #{videoId}
     </update>
 
+    <update id="updateVideoAggStatus">
+        update content_platform_video_agg
+        set status = 0,
+            update_timestamp = #{now}
+        where video_id = #{videoId}
+    </update>
+
 </mapper>

+ 1 - 0
api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

@@ -60,6 +60,7 @@
         <table tableName="content_platform_qw_plan_video" domainObjectName="ContentPlatformQwPlanVideo" alias=""/>
         <table tableName="content_platform_verify_code" domainObjectName="ContentPlatformVerifyCode" alias=""/>
         <table tableName="content_platform_video" domainObjectName="ContentPlatformVideo" alias=""/>
+        <table tableName="content_platform_video_agg" domainObjectName="ContentPlatformVideoAgg" alias=""/>
 
     </context>
 

+ 6 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/bo/VideoDetail.java

@@ -10,4 +10,10 @@ public class VideoDetail {
     private String title;
 
     private String videoPath;
+
+    // 审核状态  1 审核中,2 不通过 3 待修改,4 自己可见 5 通过
+    private Integer auditStatus;
+
+    // 推荐状态(0:不可搜,-6:待推荐,1:普通推荐,10:编辑推荐,-7:可搜索)
+    private Integer recommendStatus;
 }

+ 2 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/service/Impl/MessageAttachmentServiceImpl.java

@@ -306,6 +306,8 @@ public class MessageAttachmentServiceImpl implements MessageAttachmentService {
                 videoDetail.setCover(shareImgPath);
                 videoDetail.setTitle(title);
                 videoDetail.setVideoPath(videoPath);
+                videoDetail.setAuditStatus(jsonObject.getInteger("auditStatus"));
+                videoDetail.setRecommendStatus(jsonObject.getInteger("recommendStatus"));
                 map.put(videoId, videoDetail);
             }
             return map;

+ 34 - 3
common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/DateUtil.java

@@ -1,6 +1,8 @@
 package com.tzld.piaoquan.growth.common.utils;
 
 
+import org.springframework.util.StringUtils;
+
 import java.text.SimpleDateFormat;
 import java.time.Instant;
 import java.time.LocalDate;
@@ -8,9 +10,7 @@ import java.time.LocalDateTime;
 import java.time.ZoneId;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeParseException;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.TimeZone;
+import java.util.*;
 
 public class DateUtil {
 
@@ -164,4 +164,35 @@ public class DateUtil {
         return Date.from(localDate.atStartOfDay(zone).toInstant());
     }
 
+    public static List<String> getBeforeDays(int days) {
+        return getBeforeDays(null, null, days);
+    }
+
+    public static List<String> getBeforeDays(String beginDate, String endDate, int days) {
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
+        // 获取今天的日期
+        LocalDate today = LocalDate.now();
+        if (!StringUtils.hasText(beginDate)) {
+            beginDate = today.format(formatter);
+        }
+        if (!StringUtils.hasText(endDate)) {
+            endDate = today.format(formatter);
+        }
+        // 解析输入的日期字符串为LocalDate对象
+        LocalDate date = LocalDate.parse(beginDate, formatter);
+        LocalDate end = LocalDate.parse(endDate, formatter);
+        // 获取从输入日期前三天的日期
+        LocalDate startDate = date.minusDays(days);
+        // 存储所有日期的列表
+        List<String> datesList = new ArrayList<>();
+        // 从startDate到today遍历日期
+        while (startDate.isBefore(today) && !startDate.isAfter(end)) {
+            // 将当前日期格式化为"yyyyMMdd"并添加到列表中
+            datesList.add(startDate.format(formatter));
+            // 日期加1天
+            startDate = startDate.plusDays(1);
+        }
+        return datesList;
+    }
+
 }