#249 内容池交互 标签、猜你喜欢、收藏、日志上报

Открыто
wangyunpeng хочет смерджить 15 коммит(ов) из Server/20251105-wyp-videoCollect в Server/master
64 измененных файлов с 5221 добавлено и 167 удалено
  1. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java
  2. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/DeletedStatusEnum.java
  3. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/PlanStatusEnum.java
  4. 33 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoRecentNotUsedEnum.java
  5. 29 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoSourceEnum.java
  6. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoStatusEnum.java
  7. 45 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoTagEnum.java
  8. 41 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCollectContentController.java
  9. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java
  10. 23 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/LoghubController.java
  11. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.java
  12. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoCollectMapper.java
  13. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoTagMapper.java
  14. 69 4
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  15. 13 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformVideoMapperExt.java
  16. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/feign/LogCenterFeign.java
  17. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDatastatJob.java
  18. 266 67
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java
  19. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComCreateRoomJob.java
  20. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CollectContentListParam.java
  21. 13 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CollectContentSaveParam.java
  22. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/LogUploadParam.java
  23. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/VideoContentListParam.java
  24. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java
  25. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java
  26. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideo.java
  27. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideoExample.java
  28. 79 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAccountRel.java
  29. 581 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAccountRelExample.java
  30. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAgg.java
  31. 130 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAggExample.java
  32. 90 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoCollect.java
  33. 641 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoCollectExample.java
  34. 112 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoTag.java
  35. 791 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoTagExample.java
  36. 43 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/CollectVideoContentItemVO.java
  37. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java
  38. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/LoghubService.java
  39. 20 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCollectContentService.java
  40. 16 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java
  41. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformApiServiceImpl.java
  42. 211 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCollectContentServiceImpl.java
  43. 8 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java
  44. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformNoticeServiceImpl.java
  45. 190 37
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  46. 2 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformSettingServiceImpl.java
  47. 7 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformUploadContentServiceImpl.java
  48. 84 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/LoghubServiceImpl.java
  49. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/util/AliOssFileTool.java
  50. 3 1
      api-module/src/main/resources/application-dev.properties
  51. 3 1
      api-module/src/main/resources/application-prod.properties
  52. 3 1
      api-module/src/main/resources/application-test.properties
  53. 20 5
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml
  54. 20 3
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanVideoMapper.xml
  55. 231 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.xml
  56. 42 10
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAggMapper.xml
  57. 246 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoCollectMapper.xml
  58. 278 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoTagMapper.xml
  59. 217 16
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml
  60. 20 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformVideoMapperExt.xml
  61. 4 1
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml
  62. 80 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/BaseLogInfoDTO.java
  63. 37 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/CommonLogRequest.java
  64. 26 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/LogDetailInfo.java

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java

@@ -62,6 +62,9 @@ public enum ExceptionEnum {
     VIDEO_CITED(6007, "视频已被引用,不能删除"),
     VIDEO_GET_FAILED(6008, "视频获取失败"),
 
+    // 用户收藏视频
+    VIDEO_NOT_EXIST(7001, "视频不存在"),
+
     // 自动回复
     CGI_REPLY_BUCKET_DATA_NOT_FOUND(10000, "自动回复数据不存在"),
     CGI_REPLY_BUCKET_DATA_NOT_AUTO_REPLY(10001, "非自动回复数据"),

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/DeletedStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum DeletedStatusEnum {
+    NOT_DELETED(0, "未删除"),
+    DELETED(1, "已删除"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    DeletedStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static DeletedStatusEnum from(int val) {
+        for (DeletedStatusEnum statusEnum : DeletedStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/PlanStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum PlanStatusEnum {
+    DELETED(0, "已删除"),
+    NORMAL(1, "正常"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    PlanStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static PlanStatusEnum from(int val) {
+        for (PlanStatusEnum statusEnum : PlanStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 33 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoRecentNotUsedEnum.java

@@ -0,0 +1,33 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoRecentNotUsedEnum {
+
+    // 近期未使用 0-历史 1-近30天 2-近14天 3-近7天 4-近3天
+    HISTORY(0, "历史", 0),
+    THIRTY_DAYS(1, "近30天", 30),
+    FOURTEEN_DAYS(2, "近14天", 14),
+    SEVEN_DAYS(3, "近7天", 7),
+    THREE_DAYS(4, "近3天", 3);
+
+    private final Integer val;
+    private final String desc;
+    private final Integer days;
+
+    VideoRecentNotUsedEnum(Integer val, String desc, Integer days) {
+        this.val = val;
+        this.desc = desc;
+        this.days = days;
+    }
+
+    public static VideoRecentNotUsedEnum getByVal(Integer val) {
+        for (VideoRecentNotUsedEnum e : values()) {
+            if (e.getVal().equals(val)) {
+                return e;
+            }
+        }
+        return null;
+    }
+}

+ 29 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoSourceEnum.java

@@ -0,0 +1,29 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoSourceEnum {
+    RANK_HOT(0, "大数据热榜"),
+    ACCOUNT_RECOMMEND(1, "猜你喜欢账号视频"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+
+    VideoSourceEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static VideoSourceEnum from(int val) {
+        for (VideoSourceEnum sourceEnum : VideoSourceEnum.values()) {
+            if (sourceEnum.getVal() == val) {
+                return sourceEnum;
+            }
+        }
+        return other;
+    }
+}

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoStatusEnum {
+    DELETED(0, "已删除"),
+    NORMAL(1, "正常"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    VideoStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static VideoStatusEnum from(int val) {
+        for (VideoStatusEnum statusEnum : VideoStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 45 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoTagEnum.java

@@ -0,0 +1,45 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoTagEnum {
+    /**
+     * 票圈受欢迎
+     */
+    PLATFORM(1, "票圈受欢迎"),
+    /**
+     * 同类用户喜欢
+     */
+    TYPE(2, "同类用户喜欢"),
+    /**
+     * 你的用户爱看
+     */
+    CHANNEL(3, "你的用户爱看"),
+    /**
+     * 猜TA想看
+     */
+    ACCOUNT(4, "猜TA想看"),
+
+
+    other(999, "其他");
+
+    // 1:票圈受欢迎, 2:同类用户喜欢, 3:你的用户爱看, 4:猜TA想看
+    private final int val;
+    private final String tag;
+
+    VideoTagEnum(int val, String tag) {
+        this.val = val;
+        this.tag = tag;
+    }
+
+    public static VideoTagEnum from(int val) {
+        for (VideoTagEnum tagEnum : VideoTagEnum.values()) {
+            if (tagEnum.getVal() == val) {
+                return tagEnum;
+            }
+        }
+
+        return other;
+    }
+}

+ 41 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCollectContentController.java

@@ -0,0 +1,41 @@
+package com.tzld.piaoquan.api.controller.contentplatform;
+
+import com.tzld.piaoquan.api.model.param.contentplatform.CollectContentListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.CollectContentSaveParam;
+import com.tzld.piaoquan.api.model.vo.contentplatform.CollectVideoContentItemVO;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCollectContentService;
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/contentPlatform/collectContent")
+@CrossOrigin(origins = "*")
+public class ContentPlatformCollectContentController {
+
+    @Autowired
+    ContentPlatformCollectContentService service;
+
+    @ApiOperation(value = "收藏视频")
+    @PostMapping("/save")
+    public CommonResponse<Void> save(@RequestBody CollectContentSaveParam param) {
+        service.collectContent(param);
+        return CommonResponse.success();
+    }
+
+    @ApiOperation(value = "收藏视频列表")
+    @PostMapping("/list")
+    public CommonResponse<Page<CollectVideoContentItemVO>> list(@RequestBody CollectContentListParam param) {
+        return CommonResponse.success(service.collectContentList(param));
+    }
+
+    @ApiOperation(value = "一键清空失效视频")
+    @GetMapping("/clearInvalid")
+    public CommonResponse<Void> clearInvalid() {
+        service.clearInvalid();
+        return CommonResponse.success();
+    }
+
+}

+ 22 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java

@@ -66,6 +66,12 @@ public class ContentPlatformPlanController {
         return CommonResponse.success(planService.getUploadVideoContentList(param));
     }
 
+    @ApiOperation(value = "收藏发布内容视频列表")
+    @PostMapping("/collect/videoContentList")
+    public CommonResponse<Page<VideoContentItemVO>> getCollectVideoContentList(@RequestBody VideoContentListParam param) {
+        return CommonResponse.success(planService.getCollectVideoContentList(param));
+    }
+
     @ApiOperation(value = "发布内容视频品类列表")
     @GetMapping("/videoContentCategoryList")
     public CommonResponse<List<String>> getVideoContentCategoryList(String category) {
@@ -124,6 +130,22 @@ public class ContentPlatformPlanController {
         return CommonResponse.success();
     }
 
+    @ApiOperation(value = "同步猜你喜欢视频", hidden = true)
+    @JwtIgnore
+    @GetMapping("/job/syncRecommendedForYouVideoJob")
+    public CommonResponse<Void> syncRecommendedForYouVideoJob(String dateStr) {
+        videoJob.syncRecommendedForYouVideoJob(dateStr);
+        return CommonResponse.success();
+    }
+
+    @ApiOperation(value = "同步视频标签", hidden = true)
+    @JwtIgnore
+    @GetMapping("/job/syncVideoTagJob")
+    public CommonResponse<Void> syncVideoTagJob(String dateStr) {
+        videoJob.syncVideoTagJob(dateStr);
+        return CommonResponse.success();
+    }
+
     @ApiOperation(value = "检查视频状态", hidden = true)
     @JwtIgnore
     @GetMapping("/job/checkContentPlatformVideoStatusJob")

+ 23 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/LoghubController.java

@@ -0,0 +1,23 @@
+package com.tzld.piaoquan.api.controller.contentplatform;
+
+
+import com.tzld.piaoquan.api.model.param.contentplatform.LogUploadParam;
+import com.tzld.piaoquan.api.service.LoghubService;
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("/contentPlatform/logHub")
+@CrossOrigin(origins = "*")
+public class LoghubController {
+
+    @Autowired
+    LoghubService loghubService;
+
+    @PostMapping("/upload")
+    public CommonResponse<Void> logUpload(@RequestBody LogUploadParam param) {
+        loghubService.logUploadByKey(param.getData(), param.getKey());
+        return CommonResponse.success();
+    }
+}

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

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

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

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

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

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

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

@@ -30,11 +30,33 @@ public interface ContentPlatformPlanMapperExt {
 
     String getVideoDatastatMaxDt();
 
-    int getVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt,
-                      @Param("minScore") Double minScore);
-
     List<String> getVideoCategoryList(@Param("dt") String dt, @Param("category") String category);
 
+    int getApiVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt,
+                         @Param("minScore") Double minScore);
+
+    List<ContentPlatformVideo> getApiVideoList(@Param("param") VideoContentListParam param,
+                                               @Param("dt") String dt,
+                                               @Param("datastatDt") String datastatDt,
+                                               @Param("type") String type,
+                                               @Param("channel") String channel,
+                                               @Param("strategy") String strategy,
+                                               @Param("minScore") Double minScore,
+                                               @Param("offset") int offset,
+                                               @Param("pageSize") Integer pageSize,
+                                               @Param("sort") String sort);
+
+    int getVideoCount(@Param("param") VideoContentListParam param,
+                      @Param("dt") String dt,
+                      @Param("datastatDt") String datastatDt,
+                      @Param("type") String type,
+                      @Param("channel") String channel,
+                      @Param("strategy") String strategy,
+                      @Param("minScore") Double minScore,
+                      @Param("createAccountId") Long createAccountId,
+                      @Param("excludeVideoTime") Long excludeVideoTime,
+                      @Param("videoTagFilter") String videoTagFilter);
+
     List<ContentPlatformVideo> getVideoList(@Param("param") VideoContentListParam param,
                                             @Param("dt") String dt,
                                             @Param("datastatDt") String datastatDt,
@@ -42,6 +64,9 @@ public interface ContentPlatformPlanMapperExt {
                                             @Param("channel") String channel,
                                             @Param("strategy") String strategy,
                                             @Param("minScore") Double minScore,
+                                            @Param("createAccountId") Long createAccountId,
+                                            @Param("excludeVideoTime") Long excludeVideoTime,
+                                            @Param("videoTagFilter") String videoTagFilter,
                                             @Param("offset") int offset,
                                             @Param("pageSize") Integer pageSize,
                                             @Param("sort") String sort);
@@ -100,7 +125,7 @@ public interface ContentPlatformPlanMapperExt {
 
     void deleteContentPlatformVideo(@Param("dt") String dt);
 
-    void deleteContentPlatformVideoAgg(@Param("dt") String dt);
+    void deleteContentPlatformVideoAgg(@Param("dt") String dt, @Param("source") Integer source);
 
     void deleteContentPlatformVideoDatastatAgg(@Param("dt") String aggDt, @Param("strategy") String strategy);
 
@@ -132,4 +157,44 @@ public interface ContentPlatformPlanMapperExt {
                                               @Param("status") Integer status,
                                               @Param("now") Long now);
 
+    void deleteContentPlatformVideoAccountRel(@Param("dt") String aggDt);
+
+    void batchInsertContentPlatformVideoAccountRel(@Param("records") List<ContentPlatformVideoAccountRel> saveAccountRelList);
+
+    List<ContentPlatformVideoTag> getVideoTagList(@Param("dt") String dt,
+                                                  @Param("videoIds") List<Long> videoIds,
+                                                  @Param("accountId") Long accountId,
+                                                  @Param("type") String type,
+                                                  @Param("channel") String channel);
+
+    void deleteContentPlatformVideoTag(@Param("dt") String dt);
+
+    void batchInsertContentPlatformVideoTag(@Param("records") List<ContentPlatformVideoTag> saveList);
+
+    int getCollectVideoCount(@Param("param") VideoContentListParam param,
+                             @Param("dt") String dt,
+                             @Param("datastatDt") String datastatDt,
+                             @Param("type") String type,
+                             @Param("channel") String channel,
+                             @Param("strategy") String strategy,
+                             @Param("minScore") Double minScore,
+                             @Param("createAccountId") Long createAccountId,
+                             @Param("excludeVideoTime") Long excludeVideoTime,
+                             @Param("videoTagFilter") String videoTagFilter,
+                             @Param("videoExist") Integer videoExist);
+
+    List<Long> getCollectVideoList(@Param("param") VideoContentListParam param,
+                                   @Param("dt") String dt,
+                                   @Param("datastatDt") String datastatDt,
+                                   @Param("type") String type,
+                                   @Param("channel") String channel,
+                                   @Param("strategy") String strategy,
+                                   @Param("minScore") Double minScore,
+                                   @Param("createAccountId") Long createAccountId,
+                                   @Param("excludeVideoTime") Long excludeVideoTime,
+                                   @Param("videoTagFilter") String videoTagFilter,
+                                   @Param("videoExist") Integer videoExist,
+                                   @Param("offset") int offset,
+                                   @Param("pageSize") Integer pageSize,
+                                   @Param("sort") String sort);
 }

+ 13 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformVideoMapperExt.java

@@ -0,0 +1,13 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform.ext;
+
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollect;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ContentPlatformVideoMapperExt {
+
+    List<ContentPlatformVideoCollect> getAllInvalidCollectVideo(@Param("accountId") Long accountId, @Param("dt") String dt);
+
+    void clearInvalidCollectVideo(@Param("clearIds") List<Long> clearIds);
+}

+ 15 - 0
api-module/src/main/java/com/tzld/piaoquan/api/feign/LogCenterFeign.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.api.feign;
+
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@FeignClient(value = "log-center", url = "${api-gateway.feign.url:}", path = "/log-center")
+public interface LogCenterFeign {
+
+    @RequestMapping(value = "/log/logUpload", method = RequestMethod.POST)
+    CommonResponse logUpload(@RequestBody String request);
+
+}

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

@@ -3,6 +3,7 @@ package com.tzld.piaoquan.api.job.contentplatform;
 import com.alibaba.fastjson.JSONObject;
 import com.aliyun.odps.data.Record;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.BussinessTypeEnum;
 import com.tzld.piaoquan.api.component.AigcApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
@@ -557,13 +558,13 @@ public class ContentPlatformDatastatJob {
 
     private List<ContentPlatformAccount> getAllAccount() {
         ContentPlatformAccountExample example = new ContentPlatformAccountExample();
-        example.createCriteria().andStatusEqualTo(1);
+        example.createCriteria().andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return accountMapper.selectByExample(example);
     }
 
     private List<ContentPlatformGzhAccount> getAllGzhAccount() {
         ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
-        example.createCriteria().andStatusEqualTo(1);
+        example.createCriteria().andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return gzhAccountMapper.selectByExample(example);
     }
 

+ 266 - 67
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -3,7 +3,7 @@ package com.tzld.piaoquan.api.job.contentplatform;
 import com.aliyun.odps.data.Record;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.google.common.collect.Lists;
-import com.tzld.piaoquan.api.common.enums.contentplatform.UploadVideoAuditStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.po.contentplatform.*;
@@ -48,6 +48,8 @@ public class ContentPlatformVideoJob {
     private ContentPlatformUploadVideoMapper uploadVideoMapper;
     @Autowired
     private ContentPlatformAccountMapper accountMapper;
+    @Autowired
+    private ContentPlatformVideoAccountRelMapper videoAccountRelMapper;
 
     @Value("${video.agg.days:3}")
     private Integer videoAggDays;
@@ -91,84 +93,242 @@ public class ContentPlatformVideoJob {
                     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) {
-                                item.setStatus(0);
-                            }
-                        }
-                    }
-                }
+                getVideoCover(saveList);
                 // save
                 if (CollectionUtils.isNotEmpty(saveList)) {
-                    List<ContentPlatformVideo> videoList = getVideoList(dt);
-                    List<ContentPlatformIllegalVideo> illegalVideoList = getAllIllegalVideoList();
-                    List<Long> illegalVideoIds = illegalVideoList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
-                    if (CollectionUtils.isNotEmpty(illegalVideoIds)) {
-                        saveList = saveList.stream().filter(item -> !illegalVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
-                    }
-                    if (CollectionUtils.isNotEmpty(videoList)) {
-                        List<Long> tempExistVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
-                        List<Long> videoIdList = saveList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
-                        planMapperExt.updateOtherVideoStatus(dt, videoIdList, now);
-                        saveList = saveList.stream().filter(item -> !tempExistVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
-                        if (CollectionUtils.isNotEmpty(saveList)) {
-                            planMapperExt.batchInsertContentPlatformVideo(saveList);
-                        }
-                    } else {
-                        planMapperExt.batchInsertContentPlatformVideo(saveList);
-                    }
+                    saveVideo(dt, saveList, now);
                 }
             }
         }
         // 更新封面
         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;
-                    }
+            updateVideoCover(nullCoverVideoList);
+        }
+        long videoAggCount = getVideoAggCount(aggDt, VideoSourceEnum.RANK_HOT.getVal());
+        if (videoAggCount > 0) {
+            planMapperExt.deleteContentPlatformVideoAgg(aggDt, VideoSourceEnum.RANK_HOT.getVal());
+        }
+        // 聚合最近14天视频
+        List<ContentPlatformVideoAgg> saveAggList = planMapperExt.getVideoAggList(dtList);
+        if (CollectionUtils.isNotEmpty(saveAggList)) {
+            saveVideoAgg(aggDt, saveAggList);
+        }
+        // 获取猜你喜欢账号视频
+        syncRecommendedForYouVideo(aggDt, saveAggList);
+        // 同步视频标签
+        syncVideoTag(aggDt);
+
+        return ReturnT.SUCCESS;
+    }
+
+    private void getVideoCover(List<ContentPlatformVideo> saveList) {
+        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"));
-                    if (!cover.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)
-                            && StringUtils.hasText(detail.getVideoCoverSnapshotPath())
-                            && detail.getVideoCoverSnapshotPath().startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
-                        cover = detail.getVideoCoverSnapshotPath() + cover.substring(cover.indexOf("?"));
-                    }
                     item.setCover(cover);
                     if (detail.getAuditStatus() != 5) {
-                        item.setStatus(0);
+                        item.setStatus(VideoStatusEnum.DELETED.getVal());
                     }
-                    videoMapper.updateByPrimaryKeySelective(item);
                 }
             }
         }
-        long videoAggCount = getVideoAggCount(aggDt);
-        if (videoAggCount > 0) {
-            planMapperExt.deleteContentPlatformVideoAgg(aggDt);
+    }
+
+    private void saveVideo(String dt, List<ContentPlatformVideo> saveList, Long now) {
+        List<ContentPlatformVideo> videoList = getVideoList(dt);
+        List<ContentPlatformIllegalVideo> illegalVideoList = getAllIllegalVideoList();
+        List<Long> illegalVideoIds = illegalVideoList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(illegalVideoIds)) {
+            saveList = saveList.stream().filter(item -> !illegalVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
         }
-        // 聚合最近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);
+        if (CollectionUtils.isNotEmpty(videoList)) {
+            List<Long> tempExistVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
+            List<Long> videoIdList = saveList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
+            planMapperExt.updateOtherVideoStatus(dt, videoIdList, now);
+            saveList = saveList.stream().filter(item -> !tempExistVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.batchInsertContentPlatformVideo(saveList);
+            }
+        } else {
+            planMapperExt.batchInsertContentPlatformVideo(saveList);
+        }
+    }
+
+    private void updateVideoCover(List<ContentPlatformVideo> 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"));
+                if (!cover.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)
+                        && StringUtils.hasText(detail.getVideoCoverSnapshotPath())
+                        && detail.getVideoCoverSnapshotPath().startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
+                    cover = detail.getVideoCoverSnapshotPath() + cover.substring(cover.indexOf("?"));
+                }
+                item.setCover(cover);
+                if (detail.getAuditStatus() != 5) {
+                    item.setStatus(VideoStatusEnum.DELETED.getVal());
+                }
+                videoMapper.updateByPrimaryKeySelective(item);
+            }
+        }
+    }
+
+    private void saveVideoAgg(String aggDt, List<ContentPlatformVideoAgg> saveAggList) {
+        Long now = System.currentTimeMillis();
+        for (ContentPlatformVideoAgg item : saveAggList) {
+            item.setLastDt(item.getDt());
+            item.setDt(aggDt);
+            item.setSource(VideoSourceEnum.RANK_HOT.getVal());
+            item.setStatus(VideoStatusEnum.NORMAL.getVal());
+            item.setCreateTimestamp(now);
+        }
+        planMapperExt.batchInsertContentPlatformVideoAgg(saveAggList);
+    }
+
+    @XxlJob("syncRecommendedForYouVideoJob")
+    public ReturnT<String> syncRecommendedForYouVideoJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
+        if (StringUtils.hasText(param)) {
+            dt = param;
+        }
+        List<ContentPlatformVideoAgg> existVideoList = getVideoAggList(dt, VideoSourceEnum.RANK_HOT.getVal());
+        syncRecommendedForYouVideo(dt, existVideoList);
+        return ReturnT.SUCCESS;
+    }
+
+    private void syncRecommendedForYouVideo(String dt, List<ContentPlatformVideoAgg> existVideoList) {
+        String sql = String.format("SELECT dt, account_id, vid, merge_two_category, title, video_path, base_score, sim_score " +
+                "FROM loghubods.loghubods.new_content_platform_video_recall_i2i_pq WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideoAgg> saveList = new ArrayList<>();
+            List<ContentPlatformVideoAccountRel> saveAccountRelList = new ArrayList<>();
+            List<Long> existVideoIds = new ArrayList<>();
+            for (Record record : dataList) {
+                // 保存视频
+                Long accountId = Long.parseLong((String) record.get(1));
+                Long videoId = Long.parseLong((String) record.get(2));
+                String category = (String) record.get(3);
+                String title = (String) record.get(4);
+                String videoUrl = (String) record.get(5);
+                Double score = Double.parseDouble((String) record.get(6));
+                Double simScore = Double.parseDouble((String) record.get(7));
+                if (!existVideoIds.contains(videoId)) {
+                    ContentPlatformVideoAgg item = new ContentPlatformVideoAgg();
+                    item.setDt(dt);
+                    item.setLastDt(dt);
+                    item.setVideoId(videoId);
+                    item.setCategory(category);
+                    item.setTitle(title);
+                    item.setVideo(videoUrl);
+                    item.setScore(score);
+                    item.setSource(VideoSourceEnum.ACCOUNT_RECOMMEND.getVal());
+                    item.setStatus(VideoStatusEnum.NORMAL.getVal());
+                    item.setCreateTimestamp(now);
+                    saveList.add(item);
+                    existVideoIds.add(videoId);
+                }
+                // 保存账号关系
+                ContentPlatformVideoAccountRel accountRel = new ContentPlatformVideoAccountRel();
+                accountRel.setDt(dt);
+                accountRel.setAccountId(accountId);
+                accountRel.setVideoId(videoId);
+                accountRel.setSimScore(simScore);
+                accountRel.setCreateTimestamp(now);
+                saveAccountRelList.add(accountRel);
+            }
+            existVideoIds = existVideoList.stream().map(ContentPlatformVideoAgg::getVideoId).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(existVideoIds)) {
+                List<Long> finalExistVideoIds = existVideoIds;
+                saveList.removeIf(o -> finalExistVideoIds.contains(o.getVideoId()));
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                // 获取视频封面
+                getAggVideoCover(saveList);
+                planMapperExt.deleteContentPlatformVideoAgg(dt, VideoSourceEnum.ACCOUNT_RECOMMEND.getVal());
+                // save
+                planMapperExt.batchInsertContentPlatformVideoAgg(saveList);
+            }
+            if (CollectionUtils.isNotEmpty(saveAccountRelList)) {
+                planMapperExt.deleteContentPlatformVideoAccountRel(dt);
+                planMapperExt.batchInsertContentPlatformVideoAccountRel(saveAccountRelList);
+            }
+        }
+    }
+
+    private void getAggVideoCover(List<ContentPlatformVideoAgg> saveList) {
+        for (List<ContentPlatformVideoAgg> partition : Lists.partition(saveList, 20)) {
+            List<Long> videoIds = partition.stream().map(ContentPlatformVideoAgg::getVideoId).distinct().collect(Collectors.toList());
+            Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+            for (ContentPlatformVideoAgg 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) {
+                        item.setStatus(VideoStatusEnum.DELETED.getVal());
+                    }
+                }
             }
-            planMapperExt.batchInsertContentPlatformVideoAgg(saveAggList);
         }
+    }
+
+    @XxlJob("syncVideoTagJob")
+    public ReturnT<String> syncVideoTagJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
+        if (StringUtils.hasText(param)) {
+            dt = param;
+        }
+        syncVideoTag(dt);
         return ReturnT.SUCCESS;
     }
 
+    private void syncVideoTag(String dt) {
+        String sql = String.format("SELECT dt, vid, platform, type, channel, account, tag " +
+                "FROM loghubods.loghubods.new_content_platform_video_display_tags WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideoTag> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                Long videoId = Long.parseLong((String) record.get(1));
+                String platform = (String) record.get(2);
+                String type = (String) record.get(3);
+                String channel = (String) record.get(4);
+                String accountObj = (String) record.get(5);
+                Long accountId = "\\N".equals(accountObj) ? null : Long.parseLong(accountObj);
+                String tagObj = (String) record.get(6);
+                Integer tag = "\\N".equals(tagObj) ? null : Integer.valueOf(tagObj);
+
+                ContentPlatformVideoTag videoTag = new ContentPlatformVideoTag();
+                videoTag.setDt(dt);
+                videoTag.setVideoId(videoId);
+                videoTag.setPlatform("\\N".equals(platform) ? null : platform);
+                videoTag.setType("\\N".equals(type) ? null : type);
+                videoTag.setChannel("\\N".equals(channel) ? null : channel);
+                videoTag.setAccountId(accountId);
+                videoTag.setTag(tag);
+                videoTag.setCreateTimestamp(now);
+                saveList.add(videoTag);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.deleteContentPlatformVideoTag(dt);
+                planMapperExt.batchInsertContentPlatformVideoTag(saveList);
+            }
+        }
+    }
+
     private List<ContentPlatformIllegalVideo> getAllIllegalVideoList() {
         ContentPlatformIllegalVideoExample example = new ContentPlatformIllegalVideoExample();
         return illegalVideoMapper.selectByExample(example);
@@ -186,12 +346,18 @@ public class ContentPlatformVideoJob {
         return videoMapper.selectByExample(example);
     }
 
-    private long getVideoAggCount(String dt) {
+    private long getVideoAggCount(String dt, Integer source) {
         ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
-        example.createCriteria().andDtEqualTo(dt);
+        example.createCriteria().andDtEqualTo(dt).andSourceEqualTo(source);
         return videoAggMapper.countByExample(example);
     }
 
+    private List<ContentPlatformVideoAgg> getVideoAggList(String dt, Integer source) {
+        ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
+        example.createCriteria().andDtEqualTo(dt).andSourceEqualTo(source);
+        return videoAggMapper.selectByExample(example);
+    }
+
     @XxlJob("checkContentPlatformVideoStatusJob")
     public ReturnT<String> checkContentPlatformVideoStatusJob(String param) {
         String dt = planMapperExt.getVideoMaxDt();
@@ -363,12 +529,26 @@ public class ContentPlatformVideoJob {
         List<String> typeList = Arrays.asList("自动回复", "服务号推送", "公众号推送", "企微-社群", "企微-自动回复");
         List<ContentPlatformAccount> accountList = getAllContentPlatformAccount();
         List<String> channelList = accountList.stream().map(ContentPlatformAccount::getChannel).collect(Collectors.toList());
+        List<Long> accountIds = accountList.stream().map(ContentPlatformAccount::getId).collect(Collectors.toList());
+        List<ContentPlatformVideoAccountRel> videoAccountRelList = getContentPlatformVideoAccountRelList(accountIds);
+        Map<Long, List<ContentPlatformVideoAccountRel>> videoAccountRelMap = videoAccountRelList.stream()
+                .collect(Collectors.groupingBy(ContentPlatformVideoAccountRel::getVideoId));
+        Map<String, ContentPlatformAccount> accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformAccount::getChannel, o -> o));
         channelList.add("sum");
         List<ContentPlatformVideoDataStatAgg> saveList = new ArrayList<>();
         Long now = System.currentTimeMillis();
         String strategy = "recommend";
-        for (String type : typeList) {
-            for (String channel : channelList) {
+        for (String channel : channelList) {
+            ContentPlatformAccount account = accountMap.get(channel);
+            List<ContentPlatformVideoAccountRel> accoutnVideoAccountRelList;
+            if (Objects.nonNull(account)) {
+                accoutnVideoAccountRelList = videoAccountRelMap.getOrDefault(account.getId(), new ArrayList<>());
+            } else {
+                accoutnVideoAccountRelList = new ArrayList<>();
+            }
+            Map<Long, Double> videoSimScoreMap = accoutnVideoAccountRelList.stream().collect(
+                    Collectors.toMap(ContentPlatformVideoAccountRel::getVideoId, ContentPlatformVideoAccountRel::getSimScore));
+            for (String type : typeList) {
                 for (ContentPlatformVideoAgg video : videoList) {
                     if (!videoIdTypeChannelScoreMap.containsKey(type)) {
                         continue;
@@ -387,7 +567,8 @@ public class ContentPlatformVideoJob {
                     if (Objects.nonNull(typeVideoScoreMap) && typeVideoScoreMap.containsKey(video.getVideoId())) {
                         typeRate = typeVideoScoreMap.get(video.getVideoId());
                     }
-                    Double recommendScore = calRecommendScore(platformScore, channelRate, typeRate);
+                    Double simScore = videoSimScoreMap.getOrDefault(video.getVideoId(), 0.0);
+                    Double recommendScore = calRecommendScore(platformScore, channelRate, typeRate, simScore);
                     ContentPlatformVideoDataStatAgg agg = new ContentPlatformVideoDataStatAgg();
                     agg.setDt(datastatDt);
                     agg.setVideoId(video.getVideoId());
@@ -410,7 +591,13 @@ public class ContentPlatformVideoJob {
         return ReturnT.SUCCESS;
     }
 
-    private Double calRecommendScore(Double platformScore, Double channelRate, Double typeRate) {
+    private List<ContentPlatformVideoAccountRel> getContentPlatformVideoAccountRelList(List<Long> accountIds) {
+        ContentPlatformVideoAccountRelExample example = new ContentPlatformVideoAccountRelExample();
+        example.createCriteria().andAccountIdIn(accountIds);
+        return videoAccountRelMapper.selectByExample(example);
+    }
+
+    private Double calRecommendScore(Double platformScore, Double channelRate, Double typeRate, Double simScore) {
         // channelRate 本渠道传播率,不存在的为0
         if (Objects.isNull(channelRate)) {
             channelRate = 0.0;
@@ -419,13 +606,18 @@ public class ContentPlatformVideoJob {
         if (Objects.isNull(typeRate)) {
             typeRate = 0.0;
         }
+        // simScore 不存在的为0
+        if (Objects.isNull(simScore)) {
+            simScore = 0.0;
+        }
         Double platformWeight = recommendScoreConfig.getOrDefault("platformWeight", 0.5);
         Double channelWeight = recommendScoreConfig.getOrDefault("channelWeight", 0.5);
+        Double simWeight = recommendScoreConfig.getOrDefault("simWeight", 30.0);
         Double typeWeight = recommendScoreConfig.getOrDefault("typeWeight", 0.1);
         Double scalingWeight = recommendScoreConfig.getOrDefault("scalingWeight", 1.5);
         Double maxScore = recommendScoreConfig.getOrDefault("maxScore", 10.0);
 
-        Double score = platformWeight * platformScore + channelWeight * channelRate;
+        Double score = platformWeight * platformScore + channelWeight * channelRate + scaleScore(simWeight * simScore, 3.0);
         score += typeWeight * (10 - Math.min(10, typeRate));
         score *= scalingWeight;
 
@@ -436,10 +628,17 @@ public class ContentPlatformVideoJob {
         return bdScore.setScale(2, RoundingMode.HALF_UP).doubleValue();
     }
 
+    public static double scaleScore(Double score, Double maxScore) {
+        if (score > maxScore) {
+            return maxScore + (score - maxScore) / 10;
+        }
+        return score;
+    }
+
 
     private List<ContentPlatformAccount> getAllContentPlatformAccount() {
         ContentPlatformAccountExample example = new ContentPlatformAccountExample();
-        example.createCriteria().andStatusEqualTo(1);
+        example.createCriteria().andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return accountMapper.selectByExample(example);
     }
 
@@ -463,7 +662,7 @@ public class ContentPlatformVideoJob {
 
     private List<ContentPlatformUploadVideo> getAllUploadVideo() {
         ContentPlatformUploadVideoExample example = new ContentPlatformUploadVideoExample();
-        example.createCriteria().andIsDeleteEqualTo(0);
+        example.createCriteria().andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
         return uploadVideoMapper.selectByExample(example);
     }
 

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComCreateRoomJob.java

@@ -149,7 +149,7 @@ public class WeComCreateRoomJob {
                                List<ThirdPartWeComStaffUser> staffUserList,
                                Integer roomNum) {
         Iterator<ThirdPartWeComStaffUser> iterator = staffUserList.iterator();
-        // todo createRoom 暂时每次任务仅创建一个群
+        // createRoom 暂时每次任务仅创建一个群
         //while (iterator.hasNext()) {
         List<Long> vids = new ArrayList<>();
         List<ThirdPartWeComStaffUser> addUserList = new ArrayList<>();
@@ -206,7 +206,7 @@ public class WeComCreateRoomJob {
             setRoomAntiRequest.setAntiIds(antiSpamRuleList.stream().map(AntiSpamRuleResponse.AntiSpamRule::getId).collect(Collectors.toList()));
             apiClient.setRoomAnti(setRoomAntiRequest);
         }
-        // todo createRoom 设置管理员
+        // createRoom 设置管理员
         //apiClient.addRoomAdmins();
     }
 

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CollectContentListParam.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+import lombok.Data;
+
+@Data
+public class CollectContentListParam extends VideoContentListParam {
+
+
+}

+ 13 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CollectContentSaveParam.java

@@ -0,0 +1,13 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class CollectContentSaveParam {
+
+    @ApiModelProperty(value = "videoId")
+    private Long videoId;
+    @ApiModelProperty(value = "收藏状态 1-收藏 0-取消收藏")
+    private Integer collect;
+}

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/LogUploadParam.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+import lombok.Data;
+
+@Data
+public class LogUploadParam {
+    private String key;
+    private Object data;
+}

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

@@ -4,6 +4,8 @@ import com.tzld.piaoquan.api.model.param.PageParam;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class VideoContentListParam extends PageParam {
 
@@ -16,6 +18,15 @@ public class VideoContentListParam extends PageParam {
     @ApiModelProperty(value = "行业 0-自动回复、1-服务号推送、2-企微-社群、3-企微-自动回复、4-公众号推送")
     private Integer type = 999;
 
+    @ApiModelProperty(value = "排序类型 0-分数排序 1-更新时间")
+    private Integer sortType = 0;
+
     @ApiModelProperty(value = "排序 0-平台推荐 1-行业裂变率 2-本渠道裂变率 3-推荐指数")
     private Integer sort = 0;
+
+    @ApiModelProperty(value = "标签 ")
+    private List<Integer> tags;
+
+    @ApiModelProperty(value = "近期未使用 0-历史 1-近30天 2-近14天 3-近7天 4-近3天")
+    private Integer recentNotUsed;
 }

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

@@ -21,6 +21,8 @@ public class ContentPlatformGzhPlanVideo {
 
     private String pageUrl;
 
+    private Integer status;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -105,6 +107,14 @@ public class ContentPlatformGzhPlanVideo {
         this.pageUrl = pageUrl;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -137,6 +147,7 @@ public class ContentPlatformGzhPlanVideo {
         sb.append(", customCoverType=").append(customCoverType);
         sb.append(", video=").append(video);
         sb.append(", pageUrl=").append(pageUrl);
+        sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

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

@@ -775,6 +775,66 @@ public class ContentPlatformGzhPlanVideoExample {
             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 andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

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

@@ -13,6 +13,8 @@ public class ContentPlatformQwPlanVideo {
 
     private String video;
 
+    private Integer status;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -65,6 +67,14 @@ public class ContentPlatformQwPlanVideo {
         this.video = video;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -93,6 +103,7 @@ public class ContentPlatformQwPlanVideo {
         sb.append(", title=").append(title);
         sb.append(", cover=").append(cover);
         sb.append(", video=").append(video);
+        sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

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

@@ -505,6 +505,66 @@ public class ContentPlatformQwPlanVideoExample {
             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 andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

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

@@ -0,0 +1,79 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideoAccountRel {
+    private Long id;
+
+    private String dt;
+
+    private Long accountId;
+
+    private Long videoId;
+
+    private Double simScore;
+
+    private Long createTimestamp;
+
+    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 getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public Double getSimScore() {
+        return simScore;
+    }
+
+    public void setSimScore(Double simScore) {
+        this.simScore = simScore;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    @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(", accountId=").append(accountId);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", simScore=").append(simScore);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,581 @@
+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 ContentPlatformVideoAccountRelExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoAccountRelExample() {
+        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 andAccountIdIsNull() {
+            addCriterion("account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNotNull() {
+            addCriterion("account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdEqualTo(Long value) {
+            addCriterion("account_id =", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotEqualTo(Long value) {
+            addCriterion("account_id <>", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThan(Long value) {
+            addCriterion("account_id >", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("account_id >=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThan(Long value) {
+            addCriterion("account_id <", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("account_id <=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIn(List<Long> values) {
+            addCriterion("account_id in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotIn(List<Long> values) {
+            addCriterion("account_id not in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdBetween(Long value1, Long value2) {
+            addCriterion("account_id between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("account_id not between", value1, value2, "accountId");
+            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 andSimScoreIsNull() {
+            addCriterion("sim_score is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreIsNotNull() {
+            addCriterion("sim_score is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreEqualTo(Double value) {
+            addCriterion("sim_score =", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreNotEqualTo(Double value) {
+            addCriterion("sim_score <>", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreGreaterThan(Double value) {
+            addCriterion("sim_score >", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("sim_score >=", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreLessThan(Double value) {
+            addCriterion("sim_score <", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreLessThanOrEqualTo(Double value) {
+            addCriterion("sim_score <=", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreIn(List<Double> values) {
+            addCriterion("sim_score in", values, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreNotIn(List<Double> values) {
+            addCriterion("sim_score not in", values, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreBetween(Double value1, Double value2) {
+            addCriterion("sim_score between", value1, value2, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreNotBetween(Double value1, Double value2) {
+            addCriterion("sim_score not between", value1, value2, "simScore");
+            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 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);
+        }
+    }
+}

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

@@ -5,6 +5,10 @@ public class ContentPlatformVideoAgg {
 
     private String dt;
 
+    private String lastDt;
+
+    private Integer source;
+
     private Long videoId;
 
     private String category;
@@ -39,6 +43,22 @@ public class ContentPlatformVideoAgg {
         this.dt = dt;
     }
 
+    public String getLastDt() {
+        return lastDt;
+    }
+
+    public void setLastDt(String lastDt) {
+        this.lastDt = lastDt;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+
     public Long getVideoId() {
         return videoId;
     }
@@ -119,6 +139,8 @@ public class ContentPlatformVideoAgg {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", dt=").append(dt);
+        sb.append(", lastDt=").append(lastDt);
+        sb.append(", source=").append(source);
         sb.append(", videoId=").append(videoId);
         sb.append(", category=").append(category);
         sb.append(", title=").append(title);

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

@@ -245,6 +245,136 @@ public class ContentPlatformVideoAggExample {
             return (Criteria) this;
         }
 
+        public Criteria andLastDtIsNull() {
+            addCriterion("last_dt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtIsNotNull() {
+            addCriterion("last_dt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtEqualTo(String value) {
+            addCriterion("last_dt =", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotEqualTo(String value) {
+            addCriterion("last_dt <>", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtGreaterThan(String value) {
+            addCriterion("last_dt >", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtGreaterThanOrEqualTo(String value) {
+            addCriterion("last_dt >=", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtLessThan(String value) {
+            addCriterion("last_dt <", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtLessThanOrEqualTo(String value) {
+            addCriterion("last_dt <=", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtLike(String value) {
+            addCriterion("last_dt like", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotLike(String value) {
+            addCriterion("last_dt not like", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtIn(List<String> values) {
+            addCriterion("last_dt in", values, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotIn(List<String> values) {
+            addCriterion("last_dt not in", values, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtBetween(String value1, String value2) {
+            addCriterion("last_dt between", value1, value2, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotBetween(String value1, String value2) {
+            addCriterion("last_dt not between", value1, value2, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIsNull() {
+            addCriterion("`source` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIsNotNull() {
+            addCriterion("`source` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceEqualTo(Integer value) {
+            addCriterion("`source` =", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotEqualTo(Integer value) {
+            addCriterion("`source` <>", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceGreaterThan(Integer value) {
+            addCriterion("`source` >", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`source` >=", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLessThan(Integer value) {
+            addCriterion("`source` <", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLessThanOrEqualTo(Integer value) {
+            addCriterion("`source` <=", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIn(List<Integer> values) {
+            addCriterion("`source` in", values, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotIn(List<Integer> values) {
+            addCriterion("`source` not in", values, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceBetween(Integer value1, Integer value2) {
+            addCriterion("`source` between", value1, value2, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotBetween(Integer value1, Integer value2) {
+            addCriterion("`source` not between", value1, value2, "source");
+            return (Criteria) this;
+        }
+
         public Criteria andVideoIdIsNull() {
             addCriterion("video_id is null");
             return (Criteria) this;

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

@@ -0,0 +1,90 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideoCollect {
+    private Long id;
+
+    private Long videoId;
+
+    private String dt;
+
+    private Integer isDelete;
+
+    private Long createAccountId;
+
+    private Long createTimestamp;
+
+    private Long updateTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getDt() {
+        return dt;
+    }
+
+    public void setDt(String dt) {
+        this.dt = dt;
+    }
+
+    public Integer getIsDelete() {
+        return isDelete;
+    }
+
+    public void setIsDelete(Integer isDelete) {
+        this.isDelete = isDelete;
+    }
+
+    public Long getCreateAccountId() {
+        return createAccountId;
+    }
+
+    public void setCreateAccountId(Long createAccountId) {
+        this.createAccountId = createAccountId;
+    }
+
+    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(", videoId=").append(videoId);
+        sb.append(", dt=").append(dt);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createAccountId=").append(createAccountId);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append(", updateTimestamp=").append(updateTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,641 @@
+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 ContentPlatformVideoCollectExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoCollectExample() {
+        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 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 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 andIsDeleteIsNull() {
+            addCriterion("is_delete is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIsNotNull() {
+            addCriterion("is_delete is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteEqualTo(Integer value) {
+            addCriterion("is_delete =", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotEqualTo(Integer value) {
+            addCriterion("is_delete <>", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThan(Integer value) {
+            addCriterion("is_delete >", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_delete >=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThan(Integer value) {
+            addCriterion("is_delete <", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteLessThanOrEqualTo(Integer value) {
+            addCriterion("is_delete <=", value, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteIn(List<Integer> values) {
+            addCriterion("is_delete in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotIn(List<Integer> values) {
+            addCriterion("is_delete not in", values, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsDeleteNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_delete not between", value1, value2, "isDelete");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdIsNull() {
+            addCriterion("create_account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdIsNotNull() {
+            addCriterion("create_account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdEqualTo(Long value) {
+            addCriterion("create_account_id =", value, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdNotEqualTo(Long value) {
+            addCriterion("create_account_id <>", value, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdGreaterThan(Long value) {
+            addCriterion("create_account_id >", value, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_account_id >=", value, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdLessThan(Long value) {
+            addCriterion("create_account_id <", value, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("create_account_id <=", value, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdIn(List<Long> values) {
+            addCriterion("create_account_id in", values, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdNotIn(List<Long> values) {
+            addCriterion("create_account_id not in", values, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdBetween(Long value1, Long value2) {
+            addCriterion("create_account_id between", value1, value2, "createAccountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("create_account_id not between", value1, value2, "createAccountId");
+            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);
+        }
+    }
+}

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

@@ -0,0 +1,112 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideoTag {
+    private Long id;
+
+    private String dt;
+
+    private Long videoId;
+
+    private String platform;
+
+    private Long accountId;
+
+    private String type;
+
+    private String channel;
+
+    private Integer tag;
+
+    private Long createTimestamp;
+
+    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 getPlatform() {
+        return platform;
+    }
+
+    public void setPlatform(String platform) {
+        this.platform = platform;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getChannel() {
+        return channel;
+    }
+
+    public void setChannel(String channel) {
+        this.channel = channel;
+    }
+
+    public Integer getTag() {
+        return tag;
+    }
+
+    public void setTag(Integer tag) {
+        this.tag = tag;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    @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(", platform=").append(platform);
+        sb.append(", accountId=").append(accountId);
+        sb.append(", type=").append(type);
+        sb.append(", channel=").append(channel);
+        sb.append(", tag=").append(tag);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,791 @@
+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 ContentPlatformVideoTagExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoTagExample() {
+        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 andPlatformIsNull() {
+            addCriterion("platform is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIsNotNull() {
+            addCriterion("platform is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformEqualTo(String value) {
+            addCriterion("platform =", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotEqualTo(String value) {
+            addCriterion("platform <>", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformGreaterThan(String value) {
+            addCriterion("platform >", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformGreaterThanOrEqualTo(String value) {
+            addCriterion("platform >=", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLessThan(String value) {
+            addCriterion("platform <", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLessThanOrEqualTo(String value) {
+            addCriterion("platform <=", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLike(String value) {
+            addCriterion("platform like", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotLike(String value) {
+            addCriterion("platform not like", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIn(List<String> values) {
+            addCriterion("platform in", values, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotIn(List<String> values) {
+            addCriterion("platform not in", values, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformBetween(String value1, String value2) {
+            addCriterion("platform between", value1, value2, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotBetween(String value1, String value2) {
+            addCriterion("platform not between", value1, value2, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNull() {
+            addCriterion("account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNotNull() {
+            addCriterion("account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdEqualTo(Long value) {
+            addCriterion("account_id =", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotEqualTo(Long value) {
+            addCriterion("account_id <>", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThan(Long value) {
+            addCriterion("account_id >", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("account_id >=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThan(Long value) {
+            addCriterion("account_id <", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("account_id <=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIn(List<Long> values) {
+            addCriterion("account_id in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotIn(List<Long> values) {
+            addCriterion("account_id not in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdBetween(Long value1, Long value2) {
+            addCriterion("account_id between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("account_id not between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(String value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(String value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(String value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(String value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(String value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(String value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLike(String value) {
+            addCriterion("`type` like", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotLike(String value) {
+            addCriterion("`type` not like", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<String> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<String> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(String value1, String value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(String value1, String value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIsNull() {
+            addCriterion("channel is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIsNotNull() {
+            addCriterion("channel is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelEqualTo(String value) {
+            addCriterion("channel =", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotEqualTo(String value) {
+            addCriterion("channel <>", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelGreaterThan(String value) {
+            addCriterion("channel >", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelGreaterThanOrEqualTo(String value) {
+            addCriterion("channel >=", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLessThan(String value) {
+            addCriterion("channel <", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLessThanOrEqualTo(String value) {
+            addCriterion("channel <=", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLike(String value) {
+            addCriterion("channel like", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotLike(String value) {
+            addCriterion("channel not like", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIn(List<String> values) {
+            addCriterion("channel in", values, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotIn(List<String> values) {
+            addCriterion("channel not in", values, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelBetween(String value1, String value2) {
+            addCriterion("channel between", value1, value2, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotBetween(String value1, String value2) {
+            addCriterion("channel not between", value1, value2, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIsNull() {
+            addCriterion("tag is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIsNotNull() {
+            addCriterion("tag is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagEqualTo(Integer value) {
+            addCriterion("tag =", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotEqualTo(Integer value) {
+            addCriterion("tag <>", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGreaterThan(Integer value) {
+            addCriterion("tag >", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGreaterThanOrEqualTo(Integer value) {
+            addCriterion("tag >=", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLessThan(Integer value) {
+            addCriterion("tag <", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLessThanOrEqualTo(Integer value) {
+            addCriterion("tag <=", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIn(List<Integer> values) {
+            addCriterion("tag in", values, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotIn(List<Integer> values) {
+            addCriterion("tag not in", values, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagBetween(Integer value1, Integer value2) {
+            addCriterion("tag between", value1, value2, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotBetween(Integer value1, Integer value2) {
+            addCriterion("tag not between", value1, value2, "tag");
+            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 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);
+        }
+    }
+}

+ 43 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/CollectVideoContentItemVO.java

@@ -0,0 +1,43 @@
+package com.tzld.piaoquan.api.model.vo.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CollectVideoContentItemVO {
+
+    @ApiModelProperty(value = "videoId")
+    private Long videoId;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "封面")
+    private String cover;
+
+    @ApiModelProperty(value = "视频url")
+    private String video;
+
+    @ApiModelProperty(value = "传播效率")
+    private Double score;
+
+    @ApiModelProperty(value = "行业裂变率")
+    private Double industryFissionRate;
+
+    @ApiModelProperty(value = "本渠道裂变率")
+    private Double channelFissionRate;
+
+    @ApiModelProperty(value = "推荐指数")
+    private Double recommendScore;
+
+    @ApiModelProperty(value = "标签")
+    private List<Integer> tags;
+
+    @ApiModelProperty(value = "收藏视频状态 0-未收藏,1-已收藏")
+    private Integer collect = 0;
+
+    @ApiModelProperty(value = "收藏视频状态 0-已下架,1-正常")
+    private Integer status = 1;
+}

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

@@ -3,6 +3,8 @@ package com.tzld.piaoquan.api.model.vo.contentplatform;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class VideoContentItemVO {
 
@@ -29,4 +31,13 @@ public class VideoContentItemVO {
 
     @ApiModelProperty(value = "推荐指数")
     private Double recommendScore;
+
+    @ApiModelProperty(value = "标签")
+    private List<Integer> tags;
+
+    @ApiModelProperty(value = "收藏视频状态 0-未收藏,1-已收藏")
+    private Integer collect = 0;
+
+    @ApiModelProperty(value = "收藏视频状态 0-已下架,1-正常")
+    private Integer status = 1;
 }

+ 15 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/LoghubService.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.api.service;
+
+
+/**
+ * 日志中心接口
+ *
+ * @author liuzhiheng
+ * @version 1.0
+ * @date 2018年11月2日 下午4:58:02
+ */
+public interface LoghubService {
+
+    void logUploadByKey(Object data,String key);
+
+}

+ 20 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCollectContentService.java

@@ -0,0 +1,20 @@
+package com.tzld.piaoquan.api.service.contentplatform;
+
+import com.tzld.piaoquan.api.model.param.contentplatform.CollectContentListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.CollectContentSaveParam;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollect;
+import com.tzld.piaoquan.api.model.vo.contentplatform.CollectVideoContentItemVO;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+import java.util.List;
+
+public interface ContentPlatformCollectContentService {
+
+    void collectContent(CollectContentSaveParam param);
+
+    Page<CollectVideoContentItemVO> collectContentList(CollectContentListParam param);
+
+    void clearInvalid();
+
+    List<ContentPlatformVideoCollect> getCollectVideoList(Long id, List<Long> videoIds);
+}

+ 16 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java

@@ -42,6 +42,8 @@ public interface ContentPlatformPlanService {
 
     Page<VideoContentItemVO> getUploadVideoContentList(VideoContentListParam param);
 
+    Page<VideoContentItemVO> getCollectVideoContentList(VideoContentListParam param);
+
     List<String> getVideoContentCategoryList(String category);
 
     List<String> getVideoContentCoverFrameList(VideoContentCoverFrameParam param);
@@ -87,4 +89,18 @@ public interface ContentPlatformPlanService {
     String getGzhChannel(String ghId);
 
     void saveQwPlanVideo(QwPlanSaveVideoParam videoParam, Long planId, Long loginAccountId);
+
+    List<ContentPlatformVideoAgg> getVideoAgg(String dt, List<Long> videoIds);
+
+    ContentPlatformVideoAgg getVideoAgg(String dt, Long videoId);
+
+    String getVideoContentListSort(Integer sortType, Integer sort);
+
+    String getVideoContentListType(Integer type);
+
+    String getVideoContentListChannel(Integer sort, String channel);
+
+    String getVideoContentListTagFilterSql(List<Integer> tags, Long accountId, String type, String channel);
+
+    Long getVideoExcludeRecentNotUsed(Integer recentNotUsed);
 }

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformApiServiceImpl.java

@@ -93,12 +93,12 @@ public class ContentPlatformApiServiceImpl implements ContentPlatformApiService
         String dt = planMapperExt.getVideoMaxDt();
         String datastatDt = planMapperExt.getVideoDatastatMaxDt();
         VideoContentListParam listParam = new VideoContentListParam();
-        int count = planMapperExt.getVideoCount(listParam, dt, videoMinScore);
+        int count = planMapperExt.getApiVideoCount(listParam, dt, videoMinScore);
         result.setTotalSize(count);
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(listParam, dt, datastatDt,
+        List<ContentPlatformVideo> videoList = planMapperExt.getApiVideoList(listParam, dt, datastatDt,
                 "", "sum", "normal", videoMinScore,
                 offset, param.getPageSize(), "video.score desc");
         List<VideoIdTitleVO> list = videoList.stream().map(video -> {

+ 211 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCollectContentServiceImpl.java

@@ -0,0 +1,211 @@
+package com.tzld.piaoquan.api.service.contentplatform.impl;
+
+import com.google.common.collect.Lists;
+import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.DeletedStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.VideoTagEnum;
+import com.tzld.piaoquan.api.common.exception.CommonException;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoCollectMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformVideoMapperExt;
+import com.tzld.piaoquan.api.model.config.LoginUserContext;
+import com.tzld.piaoquan.api.model.param.contentplatform.CollectContentListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.CollectContentSaveParam;
+import com.tzld.piaoquan.api.model.po.contentplatform.*;
+import com.tzld.piaoquan.api.model.vo.contentplatform.CollectVideoContentItemVO;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCollectContentService;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
+import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
+import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Slf4j
+@Service
+public class ContentPlatformCollectContentServiceImpl implements ContentPlatformCollectContentService {
+
+    @Autowired
+    ContentPlatformVideoCollectMapper videoCollectMapper;
+    @Autowired
+    ContentPlatformPlanMapperExt planMapperExt;
+    @Autowired
+    ContentPlatformVideoMapperExt videoMapperExt;
+    @Autowired
+    ContentPlatformPlanService planService;
+    @Autowired
+    MessageAttachmentService messageAttachmentService;
+
+    @Value("${video.min.score:0.6}")
+    private Double videoMinScore;
+
+    @Override
+    public void collectContent(CollectContentSaveParam param) {
+        ContentPlatformAccount loginAccount = LoginUserContext.getUser();
+        ContentPlatformVideoCollect existCollect = getVideoCollect(param.getVideoId(), loginAccount.getId());
+        if (existCollect == null) {
+            if (param.getCollect() == 1) {
+                String dt = planMapperExt.getVideoMaxDt();
+                ContentPlatformVideoAgg videoAgg = planService.getVideoAgg(dt, param.getVideoId());
+                if (videoAgg == null) {
+                    throw new CommonException(ExceptionEnum.VIDEO_NOT_EXIST);
+                }
+                ContentPlatformVideoCollect collect = new ContentPlatformVideoCollect();
+                collect.setVideoId(param.getVideoId());
+                collect.setDt(videoAgg.getDt());
+                collect.setIsDelete(DeletedStatusEnum.NOT_DELETED.getVal());
+                collect.setCreateAccountId(loginAccount.getId());
+                collect.setCreateTimestamp(System.currentTimeMillis());
+                collect.setUpdateTimestamp(System.currentTimeMillis());
+                videoCollectMapper.insertSelective(collect);
+            }
+        } else {
+            if (param.getCollect() == 0) {
+                existCollect.setIsDelete(DeletedStatusEnum.DELETED.getVal());
+                existCollect.setUpdateTimestamp(System.currentTimeMillis());
+                videoCollectMapper.updateByPrimaryKeySelective(existCollect);
+            }
+        }
+    }
+
+    private ContentPlatformVideoCollect getVideoCollect(Long videoId, Long accountId) {
+        ContentPlatformVideoCollectExample example = new ContentPlatformVideoCollectExample();
+        example.createCriteria().andVideoIdEqualTo(videoId).andCreateAccountIdEqualTo(accountId)
+                .andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
+        List<ContentPlatformVideoCollect> list = videoCollectMapper.selectByExample(example);
+        return list.isEmpty() ? null : list.get(0);
+    }
+
+    @Override
+    public Page<CollectVideoContentItemVO> collectContentList(CollectContentListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<CollectVideoContentItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        // get sql Filter param
+        String dt = planMapperExt.getVideoMaxDt();
+        String datastatDt = planMapperExt.getVideoDatastatMaxDt();
+        String sort = planService.getVideoContentListSort(param.getSortType(), param.getSort());
+        String type = planService.getVideoContentListType(param.getType());
+        String channel = planService.getVideoContentListChannel(param.getSort(), user.getChannel());
+        String strategy = param.getSort() == 3 ? "recommend" : "normal";
+        // 标签筛选
+        String tagFilterSql = planService.getVideoContentListTagFilterSql(param.getTags(), user.getId(), type, user.getChannel());
+        // 近期未使用
+        Long excludeVideoRecentNotUsed = planService.getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
+
+        int count = planMapperExt.getCollectVideoCount(param, dt, datastatDt, type, channel, strategy,
+                videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql, null);
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<Long> videoIds = planMapperExt.getCollectVideoList(param, dt, datastatDt, type, channel, strategy,
+                videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql, null, offset, param.getPageSize(), sort);
+        List<CollectVideoContentItemVO> list = buildCollectVideoContentItemVO(videoIds, type, channel, user.getChannel(), dt, datastatDt);
+        result.setObjs(list);
+        return result;
+    }
+
+    private List<CollectVideoContentItemVO> buildCollectVideoContentItemVO(List<Long> videoIds,
+                                                                           String type,
+                                                                           String channel,
+                                                                           String userChannel,
+                                                                           String dt,
+                                                                           String datastatDt) {
+        if (CollectionUtils.isEmpty(videoIds)) {
+            return null;
+        }
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        List<Long> getCoverVideoIds = videoIds;
+        Map<Long, VideoDetail> coverMap = new HashMap<>();
+        for (List<Long> partition : Lists.partition(getCoverVideoIds, 20)) {
+            Set<Long> ids = new HashSet<>(partition);
+            coverMap.putAll(messageAttachmentService.getVideoDetail(ids));
+        }
+        List<ContentPlatformVideoDataStatAgg> videoDataStatAggList = planService.getTypeChannelVideoDataStatAggList(datastatDt,
+                type, Arrays.asList("sum", userChannel), videoIds);
+        Map<Long, Double> typeVideoScoreMap = videoDataStatAggList.stream()
+                .filter(o -> channel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+        Map<Long, Double> channelVideoScoreMap = videoDataStatAggList.stream()
+                .filter(o -> userChannel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+        Map<Long, Double> recommendTypeVideoScoreMap = videoDataStatAggList.stream()
+                .filter(o -> channel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+        Map<Long, Double> recommendChannelVideoScoreMap = videoDataStatAggList.stream()
+                .filter(o -> userChannel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+        // tag
+        List<ContentPlatformVideoTag> videoTagList = planMapperExt.getVideoTagList(dt, videoIds, user.getId(), type, userChannel);
+        Map<Long, List<ContentPlatformVideoTag>> videoTagMap = videoTagList.stream()
+                .collect(Collectors.groupingBy(ContentPlatformVideoTag::getVideoId));
+        // video
+        List<ContentPlatformVideoAgg> videoAggList = planService.getVideoAgg(dt, videoIds);
+        Map<Long, ContentPlatformVideoAgg> videoAggMap = videoAggList.stream()
+                .collect(Collectors.toMap(ContentPlatformVideoAgg::getVideoId, o -> o));
+        List<CollectVideoContentItemVO> result = new ArrayList<>();
+        for (Long videoId : videoIds) {
+            CollectVideoContentItemVO item = new CollectVideoContentItemVO();
+            result.add(item);
+            item.setVideoId(videoId);
+            item.setCollect(1);
+            ContentPlatformVideoAgg video = videoAggMap.get(videoId);
+            if (Objects.isNull(video)) {
+                item.setStatus(0);
+                continue;
+            }
+            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"));
+                item.setCover(cover);
+            }
+            item.setVideo(video.getVideo());
+            item.setScore(video.getScore());
+            item.setIndustryFissionRate(typeVideoScoreMap.get(video.getVideoId()));
+            item.setChannelFissionRate(channelVideoScoreMap.get(video.getVideoId()));
+            item.setRecommendScore(recommendChannelVideoScoreMap.get(video.getVideoId()));
+            if (Objects.isNull(item.getRecommendScore())) {
+                item.setRecommendScore(recommendTypeVideoScoreMap.get(video.getVideoId()));
+            }
+            List<ContentPlatformVideoTag> videoTags = videoTagMap.get(video.getVideoId());
+            if (CollectionUtils.isNotEmpty(videoTags)) {
+                List<Integer> tags = new ArrayList<>();
+                for (ContentPlatformVideoTag videoTag : videoTags) {
+                    VideoTagEnum tagEnum = VideoTagEnum.from(videoTag.getTag());
+                    tags.add(tagEnum.getVal());
+                }
+                item.setTags(tags);
+            }
+        }
+        return result;
+    }
+
+    @Override
+    public void clearInvalid() {
+        ContentPlatformAccount loginAccount = LoginUserContext.getUser();
+        String dt = planMapperExt.getVideoMaxDt();
+        List<ContentPlatformVideoCollect> clearList = videoMapperExt.getAllInvalidCollectVideo(loginAccount.getId(), dt);
+        if (!clearList.isEmpty()) {
+            List<Long> clearIds = clearList.stream().map(ContentPlatformVideoCollect::getId).collect(Collectors.toList());
+            videoMapperExt.clearInvalidCollectVideo(clearIds);
+        }
+    }
+
+    @Override
+    public List<ContentPlatformVideoCollect> getCollectVideoList(Long id, List<Long> videoIds) {
+        ContentPlatformVideoCollectExample example = new ContentPlatformVideoCollectExample();
+        example.createCriteria().andCreateAccountIdEqualTo(id).andVideoIdIn(videoIds)
+                .andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
+        return videoCollectMapper.selectByExample(example);
+    }
+
+}

+ 8 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java

@@ -2,6 +2,8 @@ package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.PlanStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.AigcApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhAccountMapper;
@@ -115,7 +117,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             gzhAccountMapper.insertSelective(account);
         } else {
             account.setId(param.getId());
-            account.setStatus(1);
+            account.setStatus(AccountStatusEnum.NORMAL.getVal());
             gzhAccountMapper.updateByPrimaryKeySelective(account);
         }
     }
@@ -168,7 +170,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
         }
         ContentPlatformGzhAccount gzhAccount = new ContentPlatformGzhAccount();
         gzhAccount.setId(id);
-        gzhAccount.setStatus(0);
+        gzhAccount.setStatus(AccountStatusEnum.FORBIDDEN.getVal());
         gzhAccount.setUpdateTimestamp(System.currentTimeMillis());
         gzhAccountMapper.updateByPrimaryKeySelective(gzhAccount);
     }
@@ -195,7 +197,8 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     @Override
     public List<ContentPlatformGzhAccount> getCooperateAccountListByGhIds(Long loginAccountId, List<String> ghIds) {
         ContentPlatformGzhAccountExample gzhAccountExample = new ContentPlatformGzhAccountExample();
-        gzhAccountExample.createCriteria().andCreateAccountIdEqualTo(loginAccountId).andGhIdIn(ghIds).andStatusEqualTo(1);
+        gzhAccountExample.createCriteria().andCreateAccountIdEqualTo(loginAccountId).andGhIdIn(ghIds)
+                .andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return gzhAccountMapper.selectByExample(gzhAccountExample);
     }
 
@@ -248,7 +251,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     @Override
     public ContentPlatformGzhAccount getGzhAccount(String ghId) {
         ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
-        example.createCriteria().andGhIdEqualTo(ghId).andStatusEqualTo(1);
+        example.createCriteria().andGhIdEqualTo(ghId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         List<ContentPlatformGzhAccount> accountList = gzhAccountMapper.selectByExample(example);
         if (CollectionUtils.isNotEmpty(accountList)) {
             return accountList.get(0);
@@ -259,7 +262,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     @Override
     public List<ContentPlatformGzhAccount> getAccountListByCreatorId(Long creatorId) {
         ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
-        example.createCriteria().andCreateAccountIdEqualTo(creatorId).andStatusEqualTo(1);
+        example.createCriteria().andCreateAccountIdEqualTo(creatorId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         return gzhAccountMapper.selectByExample(example);
     }
 }

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

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
+import com.tzld.piaoquan.api.common.enums.contentplatform.PlanStatusEnum;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalMsgMapper;
 import com.tzld.piaoquan.api.model.config.LoginUserContext;
 import com.tzld.piaoquan.api.model.param.contentplatform.NoticeListParam;
@@ -60,7 +61,7 @@ public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeSe
     public Long getNotReadCount() {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
         ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
-        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(0);
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(PlanStatusEnum.DELETED.getVal());
         return msgMapper.countByExample(example);
     }
 
@@ -77,7 +78,7 @@ public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeSe
     public void noticeReadAll() {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
         ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
-        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(0);
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(PlanStatusEnum.DELETED.getVal());
         ContentPlatformIllegalMsg record = new ContentPlatformIllegalMsg();
         record.setStatus(1);
         record.setUpdateTimestamp(System.currentTimeMillis());

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

@@ -3,9 +3,7 @@ package com.tzld.piaoquan.api.service.contentplatform.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
-import com.tzld.piaoquan.api.common.enums.contentplatform.ContentPlatformGzhPlanTypeEnum;
-import com.tzld.piaoquan.api.common.enums.contentplatform.PublishStageEnum;
-import com.tzld.piaoquan.api.common.enums.contentplatform.QwPlanTypeEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.*;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
@@ -24,6 +22,7 @@ import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
 import com.tzld.piaoquan.api.service.CgiReplyService;
 import com.tzld.piaoquan.api.service.GhDetailService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformAccountService;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCollectContentService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCooperateAccountService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
@@ -33,6 +32,7 @@ import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
+import com.tzld.piaoquan.growth.common.utils.DateUtils;
 import com.tzld.piaoquan.growth.common.utils.MessageUtil;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
 import lombok.extern.slf4j.Slf4j;
@@ -64,9 +64,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Autowired
     private CgiReplyBucketDataMapperExt cgiReplyBucketDataMapperExt;
     @Autowired
-    private ContentPlatformVideoMapper contentPlatformVideoMapper;
+    private ContentPlatformVideoMapper videoMapper;
     @Autowired
-    private ContentPlatformVideoAggMapper contentPlatformVideoAggMapper;
+    private ContentPlatformVideoAggMapper videoAggMapper;
     @Autowired
     private ContentPlatformGzhPlanChangeLogMapper gzhPlanChangeLogMapper;
     @Autowired
@@ -74,6 +74,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Autowired
     private ContentPlatformCooperateAccountService cooperateAccountService;
     @Autowired
+    private ContentPlatformCollectContentService videoCollectService;
+    @Autowired
     private GhDetailService ghDetailService;
     @Autowired
     private AigcApiService aigcApiService;
@@ -91,6 +93,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     private CgiReplyService cgiReplyService;
     @Autowired
     private TouLiuHttpClient touLiuHttpClient;
+    @Autowired
+    ContentPlatformCollectContentService collectService;
 
 
     @Value("${vlog.share.appType:11}")
@@ -188,7 +192,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformGzhPlanVideo> getGzhPlanVideoList(List<Long> planIds) {
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
-        example.createCriteria().andPlanIdIn(planIds);
+        example.createCriteria().andPlanIdIn(planIds).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return gzhPlanVideoMapper.selectByExample(example);
     }
 
@@ -198,7 +202,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         if (Objects.isNull(plan)) {
             throw new CommonException(ExceptionEnum.GZH_PLAN_NOT_EXISTS);
         }
-        plan.setStatus(0);
+        plan.setStatus(PlanStatusEnum.DELETED.getVal());
         plan.setUpdateTimestamp(System.currentTimeMillis());
         gzhPlanMapper.updateByPrimaryKeySelective(plan);
         if (PublishStageEnum.PLATFORM.getVal() == plan.getPublishStage()) {
@@ -232,7 +236,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         if (Objects.isNull(plan)) {
             throw new CommonException(ExceptionEnum.QW_PLAN_NOT_EXISTS);
         }
-        plan.setStatus(0);
+        plan.setStatus(PlanStatusEnum.DELETED.getVal());
         plan.setUpdateTimestamp(System.currentTimeMillis());
         qwPlanMapper.updateByPrimaryKeySelective(plan);
     }
@@ -346,7 +350,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, item -> item));
         for (ContentPlatformGzhPlanVideo item : existsVideo) {
             if (!videoIds.contains(item.getVideoId())) {
-                gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
+                //gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
+                item.setStatus(VideoStatusEnum.DELETED.getVal());
+                gzhPlanVideoMapper.updateByPrimaryKeySelective(item);
             }
         }
         for (GzhPlanVideoContentItemParam vo : param.getVideoList()) {
@@ -363,6 +369,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 item.setCover(vo.getCover());
                 item.setCustomCover(vo.getCustomCover());
                 item.setCustomCoverType(vo.getCustomCoverType());
+                item.setStatus(VideoStatusEnum.NORMAL.getVal());
                 gzhPlanVideoMapper.updateByPrimaryKey(item);
             } else {
                 ContentPlatformGzhPlanVideo item = new ContentPlatformGzhPlanVideo();
@@ -387,6 +394,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     SmallPageUrlDetail smallPageUrlDetail = json.getJSONObject("data").toJavaObject(SmallPageUrlDetail.class);
                     item.setPageUrl(smallPageUrlDetail.getUrl());
                 }
+                item.setStatus(VideoStatusEnum.NORMAL.getVal());
                 item.setCreateAccountId(loginAccount.getId());
                 item.setCreateTimestamp(System.currentTimeMillis());
                 gzhPlanVideoMapper.insert(item);
@@ -419,7 +427,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
 
     private List<ContentPlatformGzhPlanVideo> getGzhVideoByPlanId(Long planId) {
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
-        example.createCriteria().andPlanIdEqualTo(planId);
+        example.createCriteria().andPlanIdEqualTo(planId).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return gzhPlanVideoMapper.selectByExample(example);
     }
 
@@ -451,14 +459,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountId(Long accountId) {
         ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
-        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(1);
+        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         return gzhPlanMapper.selectByExample(example);
     }
 
     @Override
     public List<ContentPlatformGzhPlan> getGzhPlanListByCreateAccountId(Long createAccountId) {
         ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
-        example.createCriteria().andCreateAccountIdEqualTo(createAccountId).andStatusEqualTo(1);
+        example.createCriteria().andCreateAccountIdEqualTo(createAccountId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         return gzhPlanMapper.selectByExample(example);
     }
 
@@ -474,26 +482,81 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         ContentPlatformAccount user = LoginUserContext.getUser();
         Page<VideoContentItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
         int offset = (param.getPageNum() - 1) * param.getPageSize();
+        // get sql Filter param
         String dt = planMapperExt.getVideoMaxDt();
         String datastatDt = planMapperExt.getVideoDatastatMaxDt();
-        int count = planMapperExt.getVideoCount(param, dt, videoMinScore);
+        String sort = getVideoContentListSort(param.getSortType(), param.getSort());
+        String type = getVideoContentListType(param.getType());
+        String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
+        String strategy = param.getSort() == 3 ? "recommend" : "normal";
+        // 标签筛选
+        String tagFilterSql = getVideoContentListTagFilterSql(param.getTags(), user.getId(), type, user.getChannel());
+        // 近期未使用
+        Long excludeVideoRecentNotUsed = getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
+
+        int count = planMapperExt.getVideoCount(param, dt, datastatDt, type, channel, strategy,
+                videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql);
         result.setTotalSize(count);
         if (count == 0) {
             result.setObjs(new ArrayList<>());
             return result;
         }
-        String sort = getVideoContentListSort(param.getSort());
-        String type = getVideoContentListType(param.getType());
-        String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
-        String strategy = param.getSort() == 3 ? "recommend" : "normal";
         List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, datastatDt, type, channel, strategy,
-                videoMinScore, offset, param.getPageSize(), sort);
-        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, "sum", user.getChannel(), datastatDt);
+                videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql, offset, param.getPageSize(), sort);
+        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, "sum", user.getChannel(), dt, datastatDt);
         result.setObjs(list);
         return result;
     }
 
-    private String getVideoContentListType(Integer type) {
+    @Override
+    public String getVideoContentListTagFilterSql(List<Integer> tags, Long accountId, String type, String channel) {
+        if (CollectionUtils.isEmpty(tags)) {
+            return null;
+        }
+        StringBuilder sql = new StringBuilder("(");
+        for (Integer tag : tags) {
+            String item;
+            switch (tag) {
+                case 1:
+                    item = "videoTag.platform = 'platform'";
+                    break;
+                case 2:
+                    item = "videoTag.type = '" + type + "'";
+                    break;
+                case 3:
+                    item = "videoTag.channel = '" + channel + "'";
+                    break;
+                case 4:
+                    item = "videoTag.account_id = " + accountId;
+                    break;
+                default:
+                    item = null;
+            }
+            if (Objects.nonNull(item)) {
+                sql.append(item).append(" and ");
+            }
+        }
+        if (sql.length() > 1) {
+            sql.setLength(sql.length() - 5);
+        }
+        sql.append(")");
+        return sql.toString();
+    }
+
+    @Override
+    public Long getVideoExcludeRecentNotUsed(Integer recentNotUsed) {
+        VideoRecentNotUsedEnum videoRecentNotUsedEnum = VideoRecentNotUsedEnum.getByVal(recentNotUsed);
+        if (Objects.isNull(videoRecentNotUsedEnum)) {
+            return null;
+        }
+        if (videoRecentNotUsedEnum == VideoRecentNotUsedEnum.HISTORY) {
+            return 0L;
+        }
+        return DateUtils.todayBegin().getTime() - videoRecentNotUsedEnum.getDays() * 24 * 60 * 60 * 1000;
+    }
+
+    @Override
+    public String getVideoContentListType(Integer type) {
         switch (type) {
             case 0:
                 return "自动回复";
@@ -510,14 +573,19 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
-    private String getVideoContentListChannel(Integer sort, String channel) {
+    @Override
+    public String getVideoContentListChannel(Integer sort, String channel) {
         if (sort == 2 || sort == 3) {
             return channel;
         }
         return "sum";
     }
 
-    private String getVideoContentListSort(Integer sort) {
+    @Override
+    public String getVideoContentListSort(Integer sortType, Integer sort) {
+        if (sortType == 1) {
+            return "video.last_dt desc, video.score desc";
+        }
         switch (sort) {
             case 0:
                 return "video.score desc";
@@ -533,10 +601,15 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     }
 
     private List<VideoContentItemVO> buildVideoContentItemVOList(List<ContentPlatformVideo> videoList,
-                                                                 String type, String channel, String userChannel, String datastatDt) {
+                                                                 String type,
+                                                                 String channel,
+                                                                 String userChannel,
+                                                                 String dt,
+                                                                 String datastatDt) {
         if (CollectionUtils.isEmpty(videoList)) {
             return null;
         }
+        ContentPlatformAccount user = LoginUserContext.getUser();
         List<Long> videoIds = videoList.stream()
                 .map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
         List<Long> getCoverVideoIds = videoList.stream()
@@ -551,16 +624,24 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 type, Arrays.asList("sum", userChannel), videoIds);
         Map<Long, Double> typeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> channelVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> userChannel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> recommendTypeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> recommendChannelVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> userChannel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+        // tag
+        List<ContentPlatformVideoTag> videoTagList = planMapperExt.getVideoTagList(dt, videoIds, user.getId(), type, userChannel);
+        Map<Long, List<ContentPlatformVideoTag>> videoTagMap = videoTagList.stream()
+                .collect(Collectors.groupingBy(ContentPlatformVideoTag::getVideoId));
+        // collect
+        List<ContentPlatformVideoCollect> collectVideoList = collectService.getCollectVideoList(user.getId(), videoIds);
+        Map<Long, ContentPlatformVideoCollect> collectVideoMap = collectVideoList.stream()
+                .collect(Collectors.toMap(ContentPlatformVideoCollect::getVideoId, o -> o));
         List<VideoContentItemVO> result = new ArrayList<>();
         for (ContentPlatformVideo video : videoList) {
             VideoContentItemVO item = new VideoContentItemVO();
@@ -580,6 +661,19 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             if (Objects.isNull(item.getRecommendScore())) {
                 item.setRecommendScore(recommendTypeVideoScoreMap.get(video.getVideoId()));
             }
+            List<ContentPlatformVideoTag> videoTags = videoTagMap.get(video.getVideoId());
+            if (CollectionUtils.isNotEmpty(videoTags)) {
+                List<Integer> tags = new ArrayList<>();
+                for (ContentPlatformVideoTag videoTag : videoTags) {
+                    VideoTagEnum tagEnum = VideoTagEnum.from(videoTag.getTag());
+                    tags.add(tagEnum.getVal());
+                }
+                item.setTags(tags);
+            }
+            if (collectVideoMap.containsKey(video.getVideoId())) {
+                item.setCollect(1);
+            }
+            item.setStatus(1);
             result.add(item);
         }
         return result;
@@ -587,9 +681,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
 
     @Override
     public List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt,
-                                                                                     String type,
-                                                                                     List<String> channels,
-                                                                                     List<Long> videoIds) {
+                                                                                    String type,
+                                                                                    List<String> channels,
+                                                                                    List<Long> videoIds) {
         ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
         example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type)
                 .andChannelIn(channels);
@@ -608,12 +702,53 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             result.setObjs(new ArrayList<>());
             return result;
         }
-        String sort = getVideoContentListSort(param.getSort());
+        String sort = getVideoContentListSort(param.getSortType(), param.getSort());
         String type = getVideoContentListType(param.getType());
         String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
         List<ContentPlatformVideo> videoList = planMapperExt.getUploadVideoList(param, user.getId(), datastatDt,
                 type, channel, "normal", offset, param.getPageSize(), sort);
-        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, channel, user.getChannel(), datastatDt);
+        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, channel, user.getChannel(), datastatDt, datastatDt);
+        result.setObjs(list);
+        return result;
+    }
+
+    @Override
+    public Page<VideoContentItemVO> getCollectVideoContentList(VideoContentListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<VideoContentItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        String dt = planMapperExt.getVideoMaxDt();
+        String datastatDt = planMapperExt.getVideoDatastatMaxDt();
+        String sort = getVideoContentListSort(param.getSortType(), param.getSort());
+        String type = getVideoContentListType(param.getType());
+        String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
+        String strategy = param.getSort() == 3 ? "recommend" : "normal";
+        // 标签筛选
+        String tagFilterSql = getVideoContentListTagFilterSql(param.getTags(), user.getId(), type, user.getChannel());
+        // 近期未使用
+        Long excludeVideoRecentNotUsed = getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
+
+        int count = planMapperExt.getCollectVideoCount(param, dt, datastatDt, type, channel, strategy,
+                videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql, 1);
+        result.setTotalSize(count);
+        if (count == 0) {
+            result.setObjs(new ArrayList<>());
+            return result;
+        }
+        List<Long> videoIds = planMapperExt.getCollectVideoList(param, dt, datastatDt, type, channel,
+                strategy, videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql,
+                1, offset, param.getPageSize(), sort);
+        List<ContentPlatformVideoAgg> videoAggList = getVideoAgg(dt, videoIds);
+        List<ContentPlatformVideo> videoList = videoAggList.stream().map(o -> {
+            ContentPlatformVideo item = new ContentPlatformVideo();
+            item.setVideoId(o.getVideoId());
+            item.setTitle(o.getTitle());
+            item.setCover(o.getCover());
+            item.setVideo(o.getVideo());
+            item.setScore(o.getScore());
+            return item;
+        }).collect(Collectors.toList());
+        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, "sum", user.getChannel(), dt, datastatDt);
         result.setObjs(list);
         return result;
     }
@@ -694,7 +829,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformQwPlanVideo> getQwPlanVideoList(List<Long> planIds) {
         ContentPlatformQwPlanVideoExample example = new ContentPlatformQwPlanVideoExample();
-        example.createCriteria().andPlanIdIn(planIds);
+        example.createCriteria().andPlanIdIn(planIds).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return qwPlanVideoMapper.selectByExample(example);
     }
 
@@ -703,7 +838,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         ContentPlatformVideoExample example = new ContentPlatformVideoExample();
         example.createCriteria().andVideoIdIn(videoIds);
         example.setOrderByClause("id asc");
-        return contentPlatformVideoMapper.selectByExample(example);
+        return videoMapper.selectByExample(example);
     }
 
     @Override
@@ -711,7 +846,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
         example.createCriteria().andVideoIdIn(videoIds);
         example.setOrderByClause("id asc");
-        return contentPlatformVideoAggMapper.selectByExample(example);
+        return videoAggMapper.selectByExample(example);
     }
 
     @Override
@@ -752,6 +887,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         item.setTitle(videoParam.getTitle());
         item.setCover(videoParam.getCover());
         item.setVideo(videoParam.getVideo());
+        item.setStatus(VideoStatusEnum.NORMAL.getVal());
         item.setCreateAccountId(loginAccountId);
         item.setCreateTimestamp(System.currentTimeMillis());
         qwPlanVideoMapper.insertSelective(item);
@@ -782,7 +918,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformQwPlanVideo> getQwPlanVideoListByPlanIds(List<Long> planIds) {
         ContentPlatformQwPlanVideoExample example = new ContentPlatformQwPlanVideoExample();
-        example.createCriteria().andPlanIdIn(planIds);
+        example.createCriteria().andPlanIdIn(planIds).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return qwPlanVideoMapper.selectByExample(example);
     }
 
@@ -793,7 +929,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             ContentPlatformAccount account = accountService.getAccountById(gzhAccount.getCreateAccountId());
             ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
             example.createCriteria().andCreateAccountIdEqualTo(account.getId()).andAccountIdEqualTo(gzhAccount.getId())
-                    .andStatusEqualTo(1).andTypeEqualTo(ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal());
+                    .andStatusEqualTo(AccountStatusEnum.NORMAL.getVal()).andTypeEqualTo(ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal());
             List<ContentPlatformGzhPlan> list = gzhPlanMapper.selectByExample(example);
             if (CollectionUtils.isNotEmpty(list)) {
                 return account.getChannel();
@@ -864,6 +1000,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     item.setTitle(videoDetail.getTitle());
                     item.setCover(videoDetail.getCover());
                     item.setVideo(videoDetail.getVideoPath());
+                    item.setStatus(VideoStatusEnum.NORMAL.getVal());
                     item.setCreateAccountId(account.getId());
                     item.setCreateTimestamp(System.currentTimeMillis());
                     gzhPlanVideoMapper.insertSelective(item);
@@ -933,4 +1070,20 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
+    @Override
+    public List<ContentPlatformVideoAgg> getVideoAgg(String dt, List<Long> videoIds) {
+        ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
+        example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(dt);
+        return videoAggMapper.selectByExample(example);
+    }
+
+    @Override
+    public ContentPlatformVideoAgg getVideoAgg(String dt, Long videoId) {
+        ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
+        example.createCriteria().andDtEqualTo(dt).andVideoIdEqualTo(videoId)
+                .andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
+        List<ContentPlatformVideoAgg> list = videoAggMapper.selectByExample(example);
+        return CollectionUtils.isEmpty(list) ? null : list.get(0);
+    }
+
 }

+ 2 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformSettingServiceImpl.java

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.VideoApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformPqAccountRelMapper;
@@ -68,7 +69,7 @@ public class ContentPlatformSettingServiceImpl implements ContentPlatformSetting
     @Override
     public ContentPlatformPqAccountRel getPqAccountRel(Long accountId) {
         ContentPlatformPqAccountRelExample example = new ContentPlatformPqAccountRelExample();
-        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(1);
+        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         List<ContentPlatformPqAccountRel> pqAccountRelList = pqAccountRelMapper.selectByExample(example);
         if (CollectionUtils.isEmpty(pqAccountRelList)) {
             return null;

+ 7 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformUploadContentServiceImpl.java

@@ -1,7 +1,9 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.DeletedStatusEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.UploadVideoAuditStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.VideoStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.VideoApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanVideoMapper;
@@ -139,7 +141,7 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
         if (checkVideoCited(uploadVideo)) {
             throw new CommonException(ExceptionEnum.VIDEO_CITED);
         }
-        uploadVideo.setIsDelete(1);
+        uploadVideo.setIsDelete(DeletedStatusEnum.DELETED.getVal());
         uploadVideo.setUpdateTimestamp(System.currentTimeMillis());
         uploadVideoMapper.updateByPrimaryKeySelective(uploadVideo);
         // 调用删除视频接口
@@ -150,14 +152,14 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
     private Boolean checkVideoCited(ContentPlatformUploadVideo uploadVideo) {
         Boolean result = false;
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
-        example.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId());
+        example.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId()).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         List<ContentPlatformGzhPlanVideo> gzhPlanVideos = gzhPlanVideoMapper.selectByExample(example);
         if (CollectionUtils.isNotEmpty(gzhPlanVideos)) {
             result = true;
             return result;
         }
         ContentPlatformQwPlanVideoExample qwPlanVideoExample = new ContentPlatformQwPlanVideoExample();
-        qwPlanVideoExample.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId());
+        qwPlanVideoExample.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId()).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         List<ContentPlatformQwPlanVideo> qwPlanVideos = qwPlanVideoMapper.selectByExample(qwPlanVideoExample);
         if (CollectionUtils.isNotEmpty(qwPlanVideos)) {
             result = true;
@@ -222,7 +224,7 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
             criteria.andTitleLike("%" + param.getTitle() + "%");
         }
         criteria.andCreateAccountIdEqualTo(accountId);
-        criteria.andIsDeleteEqualTo(0);
+        criteria.andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
         return uploadVideoMapper.countByExample(example);
     }
 
@@ -236,7 +238,7 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
             criteria.andTitleLike("%" + param.getTitle() + "%");
         }
         criteria.andCreateAccountIdEqualTo(id);
-        criteria.andIsDeleteEqualTo(0);
+        criteria.andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
         example.setOrderByClause("create_timestamp desc");
         example.setPage(new Page<>(param.getPageNum(), param.getPageSize()));
         return uploadVideoMapper.selectByExample(example);

+ 84 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/LoghubServiceImpl.java

@@ -0,0 +1,84 @@
+package com.tzld.piaoquan.api.service.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.commons.aliyun.log.AliyunLogManager;
+import com.tzld.piaoquan.api.feign.LogCenterFeign;
+import com.tzld.piaoquan.api.service.LoghubService;
+import com.tzld.piaoquan.growth.common.common.base.BaseLogInfoDTO;
+import com.tzld.piaoquan.growth.common.common.base.CommonLogRequest;
+import com.tzld.piaoquan.growth.common.common.base.LogDetailInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ThreadPoolExecutor;
+
+/**
+ * @author ehlxr
+ */
+@Service
+public class LoghubServiceImpl implements LoghubService {
+    private static final Logger log = LoggerFactory.getLogger(LoghubServiceImpl.class);
+    @Autowired
+    private AliyunLogManager aliyunLogManager;
+    @Autowired
+    private ThreadPoolTaskExecutor logHubThreadPool;
+    @Value("${aliyun.log.threadpool.corePoolSize:100}")
+    private int corePoolSize;
+    @Value("${aliyun.log.threadpool.maxPoolSize:100}")
+    private int maxPoolSize;
+    @Value("${aliyun.log.threadpool.keepAliveSeconds:200}")
+    private int keepAliveSeconds;
+    @Value("${aliyun.log.threadpool.queueCapacity:100000}")
+    private int queueCapacity;
+    @Value("${aliyun.log.project:}")
+    private String project;
+
+    @Autowired
+    private LogCenterFeign logCenterFeign;
+
+    @PostConstruct
+    public void init() {
+        logHubThreadPool.setCorePoolSize(corePoolSize);
+        logHubThreadPool.setMaxPoolSize(maxPoolSize);
+        logHubThreadPool.setKeepAliveSeconds(keepAliveSeconds);
+        logHubThreadPool.setQueueCapacity(queueCapacity);
+        logHubThreadPool.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
+    }
+
+    @Override
+    public void logUploadByKey(Object data, String key) {
+        CommonLogRequest<List<JSONObject>> commonLogRequest = new CommonLogRequest<>();
+        BaseLogInfoDTO baseInfo = new BaseLogInfoDTO();
+        List<JSONObject> detail = new ArrayList<>();
+
+        LogDetailInfo logDetailInfo = new LogDetailInfo();
+        logDetailInfo.setLogUploadType(key);
+        JSONObject params = JSONObject.parseObject(JSONObject.toJSONString(data));
+        logDetailInfo.setParams(params);
+
+        detail.add((JSONObject) JSONObject.toJSON(logDetailInfo));
+
+        commonLogRequest.setBaseInfo(baseInfo);
+        commonLogRequest.setDetail(detail);
+        logCenterFeign.logUpload(JSON.toJSONString(commonLogRequest));
+    }
+
+    private void asyncSubmitLog(String project, String logStore, String topic, Map<String, Object> data) {
+        logHubThreadPool.submit(() -> {
+            try {
+                aliyunLogManager.sendLog(project, logStore, topic, data);
+            } catch (Exception e) {
+                log.error("调用阿里云loghub异常", e);
+            }
+        });
+    }
+}

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/util/AliOssFileTool.java

@@ -1220,7 +1220,7 @@ public class AliOssFileTool extends AliOssConfig {
             try {
                 ossInternalClient.restoreObject(bucket, srckey);
             } catch (Exception e) {
-                // TODO OSS Auto-generated catch blockvideo-common/src/main/java/com/weiqu/video/common/enums/ExceptionCodeEnum.java
+                // OSS Auto-generated catch blockvideo-common/src/main/java/com/weiqu/video/common/enums/ExceptionCodeEnum.java
 //				e.printStackTrace();
                 logger.error("视频可能在解冻中");
             }
@@ -1242,7 +1242,7 @@ public class AliOssFileTool extends AliOssConfig {
         try {
             isRestoreCompleted = objectMetadata.isRestoreCompleted();
         } catch (Exception e) {
-            // TODO OSS Auto-generated catch block
+            // OSS Auto-generated catch block
 //			e.printStackTrace();
             logger.error("视频可能在解冻中");
         }

+ 3 - 1
api-module/src/main/resources/application-dev.properties

@@ -26,4 +26,6 @@ feign.client.config.default.logger-level=NONE
 feign.client.config.default.connect-timeout=20000
 feign.client.config.default.read-timeout=20000
 
-eureka.client.serviceUrl.defaultZone=http://deveureka-internal.piaoquantv.com/eureka/
+eureka.client.serviceUrl.defaultZone=http://deveureka-internal.piaoquantv.com/eureka/
+
+api-gateway.feign.url=https://testapi.piaoquantv.com

+ 3 - 1
api-module/src/main/resources/application-prod.properties

@@ -24,4 +24,6 @@ feign.client.config.default.logger-level=NONE
 feign.client.config.default.connect-timeout=20000
 feign.client.config.default.read-timeout=20000
 
-eureka.client.serviceUrl.defaultZone=http://eureka-internal.piaoquantv.com/eureka/
+eureka.client.serviceUrl.defaultZone=http://eureka-internal.piaoquantv.com/eureka/
+
+api-gateway.feign.url=https://api.piaoquantv.com

+ 3 - 1
api-module/src/main/resources/application-test.properties

@@ -26,4 +26,6 @@ feign.client.config.default.logger-level=NONE
 feign.client.config.default.connect-timeout=20000
 feign.client.config.default.read-timeout=20000
 
-eureka.client.serviceUrl.defaultZone=http://testeureka-internal.piaoquantv.com/eureka/
+eureka.client.serviceUrl.defaultZone=http://testeureka-internal.piaoquantv.com/eureka/
+
+api-gateway.feign.url=https://testapi.piaoquantv.com

+ 20 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml

@@ -12,6 +12,7 @@
     <result column="custom_cover_type" jdbcType="INTEGER" property="customCoverType" />
     <result column="video" jdbcType="VARCHAR" property="video" />
     <result column="page_url" jdbcType="VARCHAR" property="pageUrl" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -75,7 +76,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, plan_id, video_id, title, custom_title, cover, custom_cover, custom_cover_type, 
-    video, page_url, create_account_id, create_timestamp
+    video, page_url, `status`, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -114,13 +115,13 @@
     insert into content_platform_gzh_plan_video (id, plan_id, video_id, 
       title, custom_title, cover, 
       custom_cover, custom_cover_type, video, 
-      page_url, create_account_id, create_timestamp
-      )
+      page_url, `status`, create_account_id, 
+      create_timestamp)
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
       #{title,jdbcType=VARCHAR}, #{customTitle,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
       #{customCover,jdbcType=VARCHAR}, #{customCoverType,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, 
-      #{pageUrl,jdbcType=VARCHAR}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
-      )
+      #{pageUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, 
+      #{createTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     insert into content_platform_gzh_plan_video
@@ -155,6 +156,9 @@
       <if test="pageUrl != null">
         page_url,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -193,6 +197,9 @@
       <if test="pageUrl != null">
         #{pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -240,6 +247,9 @@
       <if test="record.pageUrl != null">
         page_url = #{record.pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -263,6 +273,7 @@
       custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       video = #{record.video,jdbcType=VARCHAR},
       page_url = #{record.pageUrl,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -299,6 +310,9 @@
       <if test="pageUrl != null">
         page_url = #{pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -319,6 +333,7 @@
       custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       video = #{video,jdbcType=VARCHAR},
       page_url = #{pageUrl,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 20 - 3
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanVideoMapper.xml

@@ -8,6 +8,7 @@
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
     <result column="video" jdbcType="VARCHAR" property="video" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -70,7 +71,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, plan_id, video_id, title, cover, video, create_account_id, create_timestamp
+    id, plan_id, video_id, title, cover, video, `status`, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -108,10 +109,12 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideo">
     insert into content_platform_qw_plan_video (id, plan_id, video_id, 
       title, cover, video, 
-      create_account_id, create_timestamp)
+      `status`, create_account_id, create_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
       #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
-      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT})
+      #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideo">
     insert into content_platform_qw_plan_video
@@ -134,6 +137,9 @@
       <if test="video != null">
         video,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -160,6 +166,9 @@
       <if test="video != null">
         #{video,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -195,6 +204,9 @@
       <if test="record.video != null">
         video = #{record.video,jdbcType=VARCHAR},
       </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -214,6 +226,7 @@
       title = #{record.title,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
       video = #{record.video,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -238,6 +251,9 @@
       <if test="video != null">
         video = #{video,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -254,6 +270,7 @@
       title = #{title,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},
       video = #{video,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 231 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.xml

@@ -0,0 +1,231 @@
+<?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.ContentPlatformVideoAccountRelMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="account_id" jdbcType="BIGINT" property="accountId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="sim_score" jdbcType="DOUBLE" property="simScore" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </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, account_id, video_id, sim_score, create_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video_account_rel
+    <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_account_rel
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video_account_rel
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample">
+    delete from content_platform_video_account_rel
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    insert into content_platform_video_account_rel (id, dt, account_id, 
+      video_id, sim_score, create_timestamp
+      )
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, 
+      #{videoId,jdbcType=BIGINT}, #{simScore,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    insert into content_platform_video_account_rel
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dt != null">
+        dt,
+      </if>
+      <if test="accountId != null">
+        account_id,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="simScore != null">
+        sim_score,
+      </if>
+      <if test="createTimestamp != null">
+        create_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="accountId != null">
+        #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="simScore != null">
+        #{simScore,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video_account_rel
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video_account_rel
+    <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.accountId != null">
+        account_id = #{record.accountId,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.simScore != null">
+        sim_score = #{record.simScore,jdbcType=DOUBLE},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,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_account_rel
+    set id = #{record.id,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      account_id = #{record.accountId,jdbcType=BIGINT},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      sim_score = #{record.simScore,jdbcType=DOUBLE},
+      create_timestamp = #{record.createTimestamp,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.ContentPlatformVideoAccountRel">
+    update content_platform_video_account_rel
+    <set>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        account_id = #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="simScore != null">
+        sim_score = #{simScore,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    update content_platform_video_account_rel
+    set dt = #{dt,jdbcType=VARCHAR},
+      account_id = #{accountId,jdbcType=BIGINT},
+      video_id = #{videoId,jdbcType=BIGINT},
+      sim_score = #{simScore,jdbcType=DOUBLE},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 42 - 10
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAggMapper.xml

@@ -4,6 +4,8 @@
   <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="last_dt" jdbcType="VARCHAR" property="lastDt" />
+    <result column="source" jdbcType="INTEGER" property="source" />
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="category" jdbcType="VARCHAR" property="category" />
     <result column="title" jdbcType="VARCHAR" property="title" />
@@ -73,8 +75,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, dt, video_id, category, title, cover, video, score, `status`, create_timestamp, 
-    update_timestamp
+    id, dt, last_dt, `source`, 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
@@ -110,14 +112,16 @@
     </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 into content_platform_video_agg (id, dt, last_dt, 
+      `source`, video_id, category, 
+      title, cover, video, 
+      score, `status`, create_timestamp, 
+      update_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{lastDt,jdbcType=VARCHAR}, 
+      #{source,jdbcType=INTEGER}, #{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
@@ -128,6 +132,12 @@
       <if test="dt != null">
         dt,
       </if>
+      <if test="lastDt != null">
+        last_dt,
+      </if>
+      <if test="source != null">
+        `source`,
+      </if>
       <if test="videoId != null">
         video_id,
       </if>
@@ -163,6 +173,12 @@
       <if test="dt != null">
         #{dt,jdbcType=VARCHAR},
       </if>
+      <if test="lastDt != null">
+        #{lastDt,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        #{source,jdbcType=INTEGER},
+      </if>
       <if test="videoId != null">
         #{videoId,jdbcType=BIGINT},
       </if>
@@ -207,6 +223,12 @@
       <if test="record.dt != null">
         dt = #{record.dt,jdbcType=VARCHAR},
       </if>
+      <if test="record.lastDt != null">
+        last_dt = #{record.lastDt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.source != null">
+        `source` = #{record.source,jdbcType=INTEGER},
+      </if>
       <if test="record.videoId != null">
         video_id = #{record.videoId,jdbcType=BIGINT},
       </if>
@@ -243,6 +265,8 @@
     update content_platform_video_agg
     set id = #{record.id,jdbcType=BIGINT},
       dt = #{record.dt,jdbcType=VARCHAR},
+      last_dt = #{record.lastDt,jdbcType=VARCHAR},
+      `source` = #{record.source,jdbcType=INTEGER},
       video_id = #{record.videoId,jdbcType=BIGINT},
       category = #{record.category,jdbcType=VARCHAR},
       title = #{record.title,jdbcType=VARCHAR},
@@ -262,6 +286,12 @@
       <if test="dt != null">
         dt = #{dt,jdbcType=VARCHAR},
       </if>
+      <if test="lastDt != null">
+        last_dt = #{lastDt,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        `source` = #{source,jdbcType=INTEGER},
+      </if>
       <if test="videoId != null">
         video_id = #{videoId,jdbcType=BIGINT},
       </if>
@@ -295,6 +325,8 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
     update content_platform_video_agg
     set dt = #{dt,jdbcType=VARCHAR},
+      last_dt = #{lastDt,jdbcType=VARCHAR},
+      `source` = #{source,jdbcType=INTEGER},
       video_id = #{videoId,jdbcType=BIGINT},
       category = #{category,jdbcType=VARCHAR},
       title = #{title,jdbcType=VARCHAR},

+ 246 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoCollectMapper.xml

@@ -0,0 +1,246 @@
+<?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.ContentPlatformVideoCollectMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollect">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
+    <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, video_id, dt, is_delete, create_account_id, create_timestamp, update_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollectExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video_collect
+    <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_collect
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video_collect
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollectExample">
+    delete from content_platform_video_collect
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollect">
+    insert into content_platform_video_collect (id, video_id, dt, 
+      is_delete, create_account_id, create_timestamp, 
+      update_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, 
+      #{isDelete,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, 
+      #{updateTimestamp,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollect">
+    insert into content_platform_video_collect
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="dt != null">
+        dt,
+      </if>
+      <if test="isDelete != null">
+        is_delete,
+      </if>
+      <if test="createAccountId != null">
+        create_account_id,
+      </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="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="dt != null">
+        #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createAccountId != null">
+        #{createAccountId,jdbcType=BIGINT},
+      </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.ContentPlatformVideoCollectExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video_collect
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video_collect
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.dt != null">
+        dt = #{record.dt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="record.createAccountId != null">
+        create_account_id = #{record.createAccountId,jdbcType=BIGINT},
+      </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_collect
+    set id = #{record.id,jdbcType=BIGINT},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_account_id = #{record.createAccountId,jdbcType=BIGINT},
+      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.ContentPlatformVideoCollect">
+    update content_platform_video_collect
+    <set>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="isDelete != null">
+        is_delete = #{isDelete,jdbcType=INTEGER},
+      </if>
+      <if test="createAccountId != null">
+        create_account_id = #{createAccountId,jdbcType=BIGINT},
+      </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.ContentPlatformVideoCollect">
+    update content_platform_video_collect
+    set video_id = #{videoId,jdbcType=BIGINT},
+      dt = #{dt,jdbcType=VARCHAR},
+      is_delete = #{isDelete,jdbcType=INTEGER},
+      create_account_id = #{createAccountId,jdbcType=BIGINT},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      update_timestamp = #{updateTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 278 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoTagMapper.xml

@@ -0,0 +1,278 @@
+<?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.ContentPlatformVideoTagMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="platform" jdbcType="VARCHAR" property="platform" />
+    <result column="account_id" jdbcType="BIGINT" property="accountId" />
+    <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="channel" jdbcType="VARCHAR" property="channel" />
+    <result column="tag" jdbcType="INTEGER" property="tag" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </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, platform, account_id, `type`, channel, tag, create_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video_tag
+    <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_tag
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video_tag
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample">
+    delete from content_platform_video_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    insert into content_platform_video_tag (id, dt, video_id, 
+      platform, account_id, `type`, 
+      channel, tag, create_timestamp
+      )
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
+      #{platform,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, 
+      #{channel,jdbcType=VARCHAR}, #{tag,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    insert into content_platform_video_tag
+    <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="platform != null">
+        platform,
+      </if>
+      <if test="accountId != null">
+        account_id,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="channel != null">
+        channel,
+      </if>
+      <if test="tag != null">
+        tag,
+      </if>
+      <if test="createTimestamp != null">
+        create_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="platform != null">
+        #{platform,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="channel != null">
+        #{channel,jdbcType=VARCHAR},
+      </if>
+      <if test="tag != null">
+        #{tag,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video_tag
+    <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.platform != null">
+        platform = #{record.platform,jdbcType=VARCHAR},
+      </if>
+      <if test="record.accountId != null">
+        account_id = #{record.accountId,jdbcType=BIGINT},
+      </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=VARCHAR},
+      </if>
+      <if test="record.channel != null">
+        channel = #{record.channel,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tag != null">
+        tag = #{record.tag,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,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_tag
+    set id = #{record.id,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      platform = #{record.platform,jdbcType=VARCHAR},
+      account_id = #{record.accountId,jdbcType=BIGINT},
+      `type` = #{record.type,jdbcType=VARCHAR},
+      channel = #{record.channel,jdbcType=VARCHAR},
+      tag = #{record.tag,jdbcType=INTEGER},
+      create_timestamp = #{record.createTimestamp,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.ContentPlatformVideoTag">
+    update content_platform_video_tag
+    <set>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="platform != null">
+        platform = #{platform,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        account_id = #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="channel != null">
+        channel = #{channel,jdbcType=VARCHAR},
+      </if>
+      <if test="tag != null">
+        tag = #{tag,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    update content_platform_video_tag
+    set dt = #{dt,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      platform = #{platform,jdbcType=VARCHAR},
+      account_id = #{accountId,jdbcType=BIGINT},
+      `type` = #{type,jdbcType=VARCHAR},
+      channel = #{channel,jdbcType=VARCHAR},
+      tag = #{tag,jdbcType=INTEGER},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 217 - 16
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -36,8 +36,9 @@
         <if test="param.title != null and param.title != ''">
             and id in (select plan_id
             from content_platform_gzh_plan_video
-            where title like concat('%', #{param.title}, '%')
+            where (title like concat('%', #{param.title}, '%')
             or custom_title like concat('%', #{param.title}, '%'))
+            and status = 1)
         </if>
     </select>
 
@@ -67,8 +68,9 @@
         <if test="param.title != null and param.title != ''">
             and id in (select plan_id
                        from content_platform_gzh_plan_video
-                       where title like concat('%', #{param.title}, '%')
+                       where (title like concat('%', #{param.title}, '%')
                        or custom_title like concat('%', #{param.title}, '%'))
+                       and status = 1)
         </if>
         order by create_timestamp desc
         limit #{offset}, #{pageSize}
@@ -98,7 +100,7 @@
         from content_platform_video_datastat_agg
     </select>
 
-    <select id="getVideoCount" resultType="java.lang.Integer">
+    <select id="getApiVideoCount" resultType="java.lang.Integer">
         select count(1)
         from content_platform_video_agg
         where dt = #{dt} and status = 1 and score > #{minScore}
@@ -110,7 +112,7 @@
         </if>
     </select>
 
-    <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    <select id="getApiVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
         select video.*
         from content_platform_video_agg video
         left join content_platform_video_datastat_agg datastat
@@ -127,6 +129,81 @@
         limit #{offset}, #{pageSize}
     </select>
 
+    <select id="getVideoCount" resultType="java.lang.Integer">
+        select count(1)
+        from content_platform_video_agg video
+        <if test="excludeVideoTime != null">
+            left join content_platform_gzh_plan_video gzhPlanVideo
+            on gzhPlanVideo.video_id = video.video_id and gzhPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and gzhPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+            left join content_platform_qw_plan_video qwPlanVideo
+            on qwPlanVideo.video_id = video.video_id and qwPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and qwPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+        </if>
+        <if test="param.tags != null and param.tags.size() > 0">
+            join content_platform_video_tag videoTag
+            on videoTag.dt = video.dt and videoTag.video_id = video.video_id and ${videoTagFilter}
+        </if>
+        where video.dt = #{dt} and video.status = 1 and video.score > #{minScore}
+        and (video.source = 0 or video.video_id in (select video_id
+                                                    from content_platform_video_account_rel
+                                                    where dt = #{dt} and account_id = #{createAccountId}))
+        <if test="param.title!= null and param.title!= ''">
+            and video.title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and video.category = #{param.category}
+        </if>
+        <if test="excludeVideoTime != null">
+            and gzhPlanVideo.video_id is null
+            and qwPlanVideo.video_id is null
+        </if>
+    </select>
+
+    <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+        select video.*
+        from content_platform_video_agg video
+        left join content_platform_video_datastat_agg datastat
+        on datastat.dt = #{datastatDt} and datastat.type = #{type} and datastat.channel = #{channel}
+        and datastat.strategy = #{strategy} and datastat.video_id = video.video_id
+        <if test="excludeVideoTime != null">
+            left join content_platform_gzh_plan_video gzhPlanVideo
+            on gzhPlanVideo.video_id = video.video_id and gzhPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and gzhPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+            left join content_platform_qw_plan_video qwPlanVideo
+            on qwPlanVideo.video_id = video.video_id and qwPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and qwPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+        </if>
+        <if test="param.tags != null and param.tags.size() > 0">
+            join content_platform_video_tag videoTag
+            on videoTag.dt = video.dt and videoTag.video_id = video.video_id and ${videoTagFilter}
+        </if>
+        where video.dt = #{dt} and video.status = 1 and video.score > #{minScore}
+          and (video.source = 0 or video.video_id in (select video_id
+                                                      from content_platform_video_account_rel
+                                                      where dt = #{dt} and account_id = #{createAccountId}))
+        <if test="param.title!= null and param.title!= ''">
+            and video.title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and video.category = #{param.category}
+        </if>
+        <if test="excludeVideoTime != null">
+            and gzhPlanVideo.video_id is null
+            and qwPlanVideo.video_id is null
+        </if>
+        order by ${sort}
+        limit #{offset}, #{pageSize}
+    </select>
+
     <select id="getVideoMinScoreList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
         select *
         from content_platform_video_agg video
@@ -185,11 +262,12 @@
     </insert>
 
     <insert id="batchInsertContentPlatformVideoAgg">
-        insert into content_platform_video_agg (dt, video_id, category, title, cover, video, score, create_timestamp)
+        insert into content_platform_video_agg (dt, last_dt, source, 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})
+            (#{item.dt}, #{item.lastDt}, #{item.source}, #{item.videoId}, #{item.category}, #{item.title},
+            #{item.cover}, #{item.video}, #{item.score}, #{item.createTimestamp})
         </foreach>
     </insert>
 
@@ -206,8 +284,9 @@
             and sub_channel like concat('%', #{param.subChannel}, '%')
         </if>
         <if test="param.title != null and param.title != ''">
-            and id in (select plan_id from content_platform_qw_plan_video where title like concat('%', #{param.title},
-            '%'))
+            and id in (select plan_id
+                       from content_platform_qw_plan_video
+                       where title like concat('%', #{param.title}, '%') and status = 1)
         </if>
     </select>
 
@@ -225,8 +304,9 @@
             and sub_channel like concat('%', #{param.subChannel}, '%')
         </if>
         <if test="param.title != null and param.title != ''">
-            and id in (select plan_id from content_platform_qw_plan_video where title like concat('%', #{param.title},
-            '%'))
+            and id in (select plan_id
+                       from content_platform_qw_plan_video
+                       where title like concat('%', #{param.title}, '%') and status = 1)
         </if>
         order by create_timestamp desc
         limit #{offset}, #{pageSize}
@@ -261,14 +341,16 @@
           and cpgac.status = 1
           and cpgp.scene = 0
           and cpgp.status = 1
+          and cpgpv.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
+        SELECT t.video_id, t.category, t.title, t.cover, t.video, round(t.avg_score, 3) as score, t.dt
         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
+            ROW_NUMBER() OVER (PARTITION BY video_id ORDER BY dt DESC) AS rn,
+            MAX(dt) OVER (PARTITION BY video_id) AS dt
         FROM content_platform_video
         where dt in
         <foreach collection="dtList" item="item" open="(" close=")" separator=",">
@@ -317,7 +399,7 @@
     </delete>
 
     <delete id="deleteContentPlatformVideoAgg">
-        delete from content_platform_video_agg where dt = #{dt}
+        delete from content_platform_video_agg where dt = #{dt} and source = #{source}
     </delete>
 
     <delete id="deleteContentPlatformVideoDatastatAgg">
@@ -369,7 +451,7 @@
                coalesce(nullif(video.custom_title, ''), video.title) as title
         from content_platform_gzh_plan plan
         join content_platform_gzh_plan_video video on plan.id = video.plan_id
-        where video.video_id = #{videoId} and plan.`status` = 1
+        where video.video_id = #{videoId} and plan.`status` = 1 and video.status = 1
     </select>
 
     <select id="getQwPlanIllegalVideoList"
@@ -377,7 +459,7 @@
         select plan.create_account_id as account_id, plan.type, video.video_id, '企微' as channel, video.title
         from content_platform_qw_plan plan
         join content_platform_qw_plan_video video on plan.id = video.plan_id
-        where video.video_id = #{videoId} and plan.`status` = 1
+        where video.video_id = #{videoId} and plan.`status` = 1 and video.status = 1
     </select>
 
     <select id="getUploadVideoCount" resultType="java.lang.Integer">
@@ -411,5 +493,124 @@
         where video_id = #{videoId}
     </update>
 
+    <delete id="deleteContentPlatformVideoAccountRel">
+        delete from content_platform_video_account_rel where dt = #{dt}
+    </delete>
+
+    <insert id="batchInsertContentPlatformVideoAccountRel">
+        insert into content_platform_video_account_rel (dt, account_id, video_id, sim_score, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dt}, #{item.accountId}, #{item.videoId}, #{item.simScore}, #{item.createTimestamp})
+        </foreach>
+    </insert>
+
+    <select id="getVideoTagList"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+        select *
+        from content_platform_video_tag
+        where dt = #{dt} and video_id in
+        <foreach collection="videoIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        and (platform = 'platform' or account_id = #{accountId} or type = #{type} or channel = #{channel})
+    </select>
+
+    <delete id="deleteContentPlatformVideoTag">
+        delete from content_platform_video_tag where dt = #{dt}
+    </delete>
+
+    <insert id="batchInsertContentPlatformVideoTag">
+        insert into content_platform_video_tag (dt, account_id, video_id, platform, type, channel, tag, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dt}, #{item.accountId}, #{item.videoId}, #{item.platform}, #{item.type}, #{item.channel}, #{item.tag}, #{item.createTimestamp})
+        </foreach>
+    </insert>
+
+    <select id="getCollectVideoCount" resultType="java.lang.Integer">
+        select count(1)
+        from content_platform_video_collect collect
+        left join content_platform_video_agg video
+        on collect.video_id = video.video_id and video.dt = #{dt} and video.status = 1 and video.score > #{minScore}
+        and (video.source = 0 or video.video_id in (select video_id
+                                                    from content_platform_video_account_rel
+                                                    where dt = #{dt} and account_id = #{createAccountId}))
+        <if test="excludeVideoTime != null">
+            left join content_platform_gzh_plan_video gzhPlanVideo
+            on gzhPlanVideo.video_id = video.video_id and gzhPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and gzhPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+            left join content_platform_qw_plan_video qwPlanVideo
+            on qwPlanVideo.video_id = video.video_id and qwPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and qwPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+        </if>
+        <if test="param.tags != null and param.tags.size() > 0">
+            join content_platform_video_tag videoTag
+            on videoTag.dt = video.dt and videoTag.video_id = video.video_id and ${videoTagFilter}
+        </if>
+        where collect.is_delete = 0 and collect.create_account_id = #{createAccountId}
+        <if test="videoExist != null">
+            and video.video_id is not null
+        </if>
+        <if test="param.title!= null and param.title!= ''">
+            and video.title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and video.category = #{param.category}
+        </if>
+        <if test="excludeVideoTime != null">
+            and gzhPlanVideo.video_id is null
+            and qwPlanVideo.video_id is null
+        </if>
+    </select>
+
+    <select id="getCollectVideoList" resultType="java.lang.Long">
+        select collect.video_id
+        from content_platform_video_collect collect
+        left join content_platform_video_agg video
+        on collect.video_id = video.video_id and video.dt = #{dt} and video.status = 1 and video.score > #{minScore}
+        and (video.source = 0 or video.video_id in (select video_id
+                                                    from content_platform_video_account_rel
+                                                    where dt = #{dt} and account_id = #{createAccountId}))
+        left join content_platform_video_datastat_agg datastat
+        on datastat.dt = #{datastatDt} and datastat.type = #{type} and datastat.channel = #{channel}
+        and datastat.strategy = #{strategy} and datastat.video_id = video.video_id
+        <if test="excludeVideoTime != null">
+            left join content_platform_gzh_plan_video gzhPlanVideo
+            on gzhPlanVideo.video_id = video.video_id and gzhPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and gzhPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+            left join content_platform_qw_plan_video qwPlanVideo
+            on qwPlanVideo.video_id = video.video_id and qwPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and qwPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+        </if>
+        <if test="param.tags != null and param.tags.size() > 0">
+            join content_platform_video_tag videoTag
+            on videoTag.dt = video.dt and videoTag.video_id = video.video_id and ${videoTagFilter}
+        </if>
+        where collect.is_delete = 0 and collect.create_account_id = #{createAccountId}
+        <if test="videoExist != null">
+            and video.video_id is not null
+        </if>
+        <if test="param.title!= null and param.title!= ''">
+            and video.title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and video.category = #{param.category}
+        </if>
+        <if test="excludeVideoTime != null">
+            and gzhPlanVideo.video_id is null
+            and qwPlanVideo.video_id is null
+        </if>
+        order by ${sort}
+        limit #{offset}, #{pageSize}
+    </select>
 
 </mapper>

+ 20 - 0
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformVideoMapperExt.xml

@@ -0,0 +1,20 @@
+<?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.ext.ContentPlatformVideoMapperExt">
+
+    <update id="clearInvalidCollectVideo">
+        update content_platform_video_collect set is_deleted = 1 where id in
+        <foreach collection="clearIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </update>
+
+    <select id="getAllInvalidCollectVideo"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoCollect">
+        select collect.*
+        from content_platform_video_collect collect
+        left join content_platform_video_agg video on collect.video_id = video.video_id and video.dt = #{dt}
+        where collect.create_account_id = #{accountId} and collect.is_deleted = 0 and video.video_id is null
+    </select>
+
+</mapper>

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

@@ -76,7 +76,10 @@
 <!--        <table tableName="content_platform_illegal_video" domainObjectName="ContentPlatformIllegalVideo" alias=""/>-->
 <!--        <table tableName="content_platform_illegal_msg" domainObjectName="ContentPlatformIllegalMsg" alias=""/>-->
 <!--        <table tableName="content_platform_pq_account_rel" domainObjectName="ContentPlatformPqAccountRel" alias=""/>-->
-        <table tableName="content_platform_upload_video" domainObjectName="ContentPlatformUploadVideo" alias=""/>
+<!--        <table tableName="content_platform_upload_video" domainObjectName="ContentPlatformUploadVideo" alias=""/>-->
+<!--        <table tableName="content_platform_video_account_rel" domainObjectName="ContentPlatformVideoAccountRel" alias=""/>-->
+<!--        <table tableName="content_platform_video_tag" domainObjectName="ContentPlatformVideoTag" alias=""/>-->
+        <table tableName="content_platform_video_collect" domainObjectName="ContentPlatformVideoCollect" alias=""/>
     </context>
 
 </generatorConfiguration>

+ 80 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/BaseLogInfoDTO.java

@@ -0,0 +1,80 @@
+package com.tzld.piaoquan.growth.common.common.base;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class BaseLogInfoDTO {
+
+    /// 用户信息
+    @ApiModelProperty(value = "公共参数-token值")
+    private String token;
+    @ApiModelProperty(value = "公共参数-登录用户ID")
+    private String loginUid;
+
+    /// 应用信息
+    @ApiModelProperty(value = "公共参数-应用版本号")
+    private String appVersionCode;
+    @ApiModelProperty(value = "公共参数-产品代号")
+    private String appType;
+
+    /// 设备信息
+    @ApiModelProperty(value = "公共参数-手机设备的唯一码")
+    private String machineCode;
+    @ApiModelProperty(value = "公共参数-ios,android")
+    private String platform;
+    @ApiModelProperty(value = "公共参数-系统版本(例:ios10.1)")
+    private String systemVersion;
+    @ApiModelProperty(value = "公共参数-手机信息")
+    private String machineInfo;
+    @ApiModelProperty(value = "公共参数-网络类型 WI-FI 5G 4G 3G 2G")
+    private String networkType;
+    @ApiModelProperty(value = "公共参数-客户端ip")
+    private String clientIp;
+
+    // pageSource相关的参数
+    @ApiModelProperty(value = "公共参数-页面来源")
+    private String pageSource;
+
+    // 某次操作相关的参数
+    @ApiModelProperty(value = "公共参数-前端请求时间")
+    private String clientTimestamp;
+    @ApiModelProperty(value = "公共参数-sessionId")
+    private String sessionId;
+    @ApiModelProperty(value = "公共参数-requestId,每次请求客户端生成唯一ID,不超过64位")
+    private String requestId;
+
+    @ApiModelProperty(value = "公共参数-页面分类ID,只在首页分发列表中才有")
+    private String pageCategoryId;
+    @ApiModelProperty(value = "公共参数-root页面来源")
+    private String rootPageSource;
+    @ApiModelProperty(value = "公共参数-root页面分类ID")
+    private String rootPageCategoryId;
+    // 某次操作相关的参数
+    @ApiModelProperty(value = "公共参数-小程序打开类型")
+    private String openType;
+    @ApiModelProperty(value = "公共参数-分享的深度")
+    private String shareDepth;
+    @ApiModelProperty(value = "公共参数-事件ID")
+    private String eventId;
+    @ApiModelProperty(value = "公共参数-视频上报数据,使用后端返回的原样数据")
+    private String videoReportMeta;
+    @ApiModelProperty(value = "公共参数-root页面时间戳")
+    private String rootPageTimestamp;
+    @ApiModelProperty(value = "公共参数-subSessionId")
+    private String subSessionId;
+    @ApiModelProperty(value = "公共参数-returnId")
+    private String returnId;
+
+    private Integer senceType;
+
+    private Integer hotSenceType;
+
+    private String softVersion;
+
+    private String eventIds;
+
+    private String eventInfos;
+
+    private String abExpInfo;
+}

+ 37 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/CommonLogRequest.java

@@ -0,0 +1,37 @@
+package com.tzld.piaoquan.growth.common.common.base;
+
+public class CommonLogRequest<T> {
+
+
+    /**
+     * 基础信息
+     */
+    BaseLogInfoDTO baseInfo;
+    /**
+     * 请求参数
+     */
+    T detail;
+
+
+    public BaseLogInfoDTO getBaseInfo() {
+        return baseInfo;
+    }
+
+    public void setBaseInfo(BaseLogInfoDTO baseInfo) {
+        this.baseInfo = baseInfo;
+    }
+
+    public T getDetail() {
+        return detail;
+    }
+
+    public void setDetail(T detail) {
+        this.detail = detail;
+    }
+
+    @Override
+    public String toString() {
+        return "CommonRequest{" + "baseInfo=" + baseInfo + ", params=" + detail + '}';
+    }
+
+}

+ 26 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/LogDetailInfo.java

@@ -0,0 +1,26 @@
+package com.tzld.piaoquan.growth.common.common.base;
+
+import com.alibaba.fastjson.JSONObject;
+
+public class LogDetailInfo {
+
+    private String logUploadType;
+
+    private JSONObject params;
+
+    public String getLogUploadType() {
+        return logUploadType;
+    }
+
+    public void setLogUploadType(String logUploadType) {
+        this.logUploadType = logUploadType;
+    }
+
+    public JSONObject getParams() {
+        return params;
+    }
+
+    public void setParams(JSONObject params) {
+        this.params = params;
+    }
+}