Ver código fonte

内容池收藏

wangyunpeng 1 semana atrás
pai
commit
fef8ad24a6
28 arquivos alterados com 1851 adições e 23 exclusões
  1. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java
  2. 41 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCollectContentController.java
  3. 6 0
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java
  4. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoCollectMapper.java
  5. 37 10
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  6. 13 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformVideoMapperExt.java
  7. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/feign/LogCenterFeign.java
  8. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CollectContentListParam.java
  9. 13 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CollectContentSaveParam.java
  10. 90 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoCollect.java
  11. 641 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoCollectExample.java
  12. 40 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/CollectVideoContentItemVO.java
  13. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/LoghubService.java
  14. 15 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCollectContentService.java
  15. 16 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java
  16. 202 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCollectContentServiceImpl.java
  17. 74 9
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  18. 84 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/LoghubServiceImpl.java
  19. 3 1
      api-module/src/main/resources/application-dev.properties
  20. 3 1
      api-module/src/main/resources/application-prod.properties
  21. 3 1
      api-module/src/main/resources/application-test.properties
  22. 246 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoCollectMapper.xml
  23. 87 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml
  24. 20 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformVideoMapperExt.xml
  25. 2 1
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml
  26. 80 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/BaseLogInfoDTO.java
  27. 37 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/common/base/CommonLogRequest.java
  28. 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

@@ -61,6 +61,9 @@ public enum ExceptionEnum {
     PQ_ACCOUNT_NOT_BINDING(6006, "票圈账号未绑定"),
     VIDEO_CITED(6007, "视频已被引用,不能删除"),
 
+    // 用户收藏视频
+    VIDEO_NOT_EXIST(7001, "视频不存在"),
+
     // 自动回复
     CGI_REPLY_BUCKET_DATA_NOT_FOUND(10000, "自动回复数据不存在"),
     CGI_REPLY_BUCKET_DATA_NOT_AUTO_REPLY(10001, "非自动回复数据"),

+ 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();
+    }
+
+}

+ 6 - 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() {

+ 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);
+}

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

@@ -33,18 +33,18 @@ public interface ContentPlatformPlanMapperExt {
     List<String> getVideoCategoryList(@Param("dt") String dt);
 
     int getApiVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt,
-                      @Param("minScore") Double minScore);
+                         @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);
+                                               @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,
@@ -170,4 +170,31 @@ public interface ContentPlatformPlanMapperExt {
     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);
+
+}

+ 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;
+}

+ 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);
+        }
+    }
+}

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

@@ -0,0 +1,40 @@
+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 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);
+
+}

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

@@ -0,0 +1,15 @@
+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.vo.contentplatform.CollectVideoContentItemVO;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+
+public interface ContentPlatformCollectContentService {
+
+    void collectContent(CollectContentSaveParam param);
+
+    Page<CollectVideoContentItemVO> collectContentList(CollectContentListParam param);
+
+    void clearInvalid();
+}

+ 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();
 
     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);
 }

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

@@ -0,0 +1,202 @@
+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);
+            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);
+        }
+    }
+
+}

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

@@ -22,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;
@@ -63,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
@@ -73,6 +74,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Autowired
     private ContentPlatformCooperateAccountService cooperateAccountService;
     @Autowired
+    private ContentPlatformCollectContentService videoCollectService;
+    @Autowired
     private GhDetailService ghDetailService;
     @Autowired
     private AigcApiService aigcApiService;
@@ -503,7 +506,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return result;
     }
 
-    private String getVideoContentListTagFilterSql(List<Integer> tags, Long accountId, String type, String channel) {
+    @Override
+    public String getVideoContentListTagFilterSql(List<Integer> tags, Long accountId, String type, String channel) {
         if (CollectionUtils.isEmpty(tags)) {
             return null;
         }
@@ -537,7 +541,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return sql.toString();
     }
 
-    private Long getVideoExcludeRecentNotUsed(Integer recentNotUsed) {
+    @Override
+    public Long getVideoExcludeRecentNotUsed(Integer recentNotUsed) {
         VideoRecentNotUsedEnum videoRecentNotUsedEnum = VideoRecentNotUsedEnum.getByVal(recentNotUsed);
         if (Objects.isNull(videoRecentNotUsedEnum)) {
             return null;
@@ -548,7 +553,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return DateUtils.todayBegin().getTime() - videoRecentNotUsedEnum.getDays() * 24 * 60 * 60 * 1000;
     }
 
-    private String getVideoContentListType(Integer type) {
+    @Override
+    public String getVideoContentListType(Integer type) {
         switch (type) {
             case 0:
                 return "自动回复";
@@ -565,14 +571,16 @@ 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 sortType, Integer sort) {
+    @Override
+    public String getVideoContentListSort(Integer sortType, Integer sort) {
         if (sortType == 1) {
             return "video.last_dt desc, video.score desc";
         }
@@ -694,6 +702,47 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         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;
+    }
+
     @Override
     public List<String> getVideoContentCategoryList() {
         String dt = planMapperExt.getVideoMaxDt();
@@ -779,7 +828,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
@@ -787,7 +836,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
@@ -1011,4 +1060,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);
+    }
+
 }

+ 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) JSONObject.toJSON(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);
+            }
+        });
+    }
+}

+ 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

+ 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>

+ 87 - 0
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -525,4 +525,91 @@
         </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 collect.is_delete = 0 and video.dt = #{dt} and video.status = 1
+        and video.score > #{minScore} and collect.create_account_id = #{createAccountId}
+        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
+        <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 collect.is_delete = 0 and video.dt = #{dt} and video.status = 1
+        and video.score > #{minScore} and collect.create_account_id = #{createAccountId}
+        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
+        <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>

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

@@ -78,7 +78,8 @@
 <!--        <table tableName="content_platform_pq_account_rel" domainObjectName="ContentPlatformPqAccountRel" 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_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;
+    }
+}