Browse Source

Merge branch 'master' into dev-xym-add-match-video

xueyiming 6 months ago
parent
commit
f779cae1ac

+ 5 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/VideoDetail.java

@@ -1,8 +1,10 @@
 package com.tzld.piaoquan.longarticle.model.bo;
 
 import lombok.Data;
+import lombok.ToString;
 
 @Data
+@ToString
 public class VideoDetail {
 
     private Integer crawlerVideoId;
@@ -15,7 +17,9 @@ public class VideoDetail {
 
     private String videoId;
 
-    private String videoCover;
+    private String shareImgPath;
+
+    private String coverImgPath;
 
     private String videoPath;
 

+ 55 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/CrawlerVideo.java

@@ -37,6 +37,16 @@ public class CrawlerVideo {
 
     private Float score;
 
+    private Integer isIllegal;
+
+    private Integer status;
+
+    private String auditAccount;
+
+    private Long auditTimestamp;
+
+    private Byte scoreVersion;
+
     private String videoUrl;
 
     private String coverUrl;
@@ -177,6 +187,46 @@ public class CrawlerVideo {
         this.score = score;
     }
 
+    public Integer getIsIllegal() {
+        return isIllegal;
+    }
+
+    public void setIsIllegal(Integer isIllegal) {
+        this.isIllegal = isIllegal;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getAuditAccount() {
+        return auditAccount;
+    }
+
+    public void setAuditAccount(String auditAccount) {
+        this.auditAccount = auditAccount;
+    }
+
+    public Long getAuditTimestamp() {
+        return auditTimestamp;
+    }
+
+    public void setAuditTimestamp(Long auditTimestamp) {
+        this.auditTimestamp = auditTimestamp;
+    }
+
+    public Byte getScoreVersion() {
+        return scoreVersion;
+    }
+
+    public void setScoreVersion(Byte scoreVersion) {
+        this.scoreVersion = scoreVersion;
+    }
+
     public String getVideoUrl() {
         return videoUrl;
     }
@@ -216,6 +266,11 @@ public class CrawlerVideo {
         sb.append(", userId=").append(userId);
         sb.append(", traceId=").append(traceId);
         sb.append(", score=").append(score);
+        sb.append(", isIllegal=").append(isIllegal);
+        sb.append(", status=").append(status);
+        sb.append(", auditAccount=").append(auditAccount);
+        sb.append(", auditTimestamp=").append(auditTimestamp);
+        sb.append(", scoreVersion=").append(scoreVersion);
         sb.append(", videoUrl=").append(videoUrl);
         sb.append(", coverUrl=").append(coverUrl);
         sb.append("]");

+ 310 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/CrawlerVideoExample.java

@@ -1215,6 +1215,316 @@ public class CrawlerVideoExample {
             addCriterion("score not between", value1, value2, "score");
             return (Criteria) this;
         }
+
+        public Criteria andIsIllegalIsNull() {
+            addCriterion("is_illegal is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalIsNotNull() {
+            addCriterion("is_illegal is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalEqualTo(Integer value) {
+            addCriterion("is_illegal =", value, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalNotEqualTo(Integer value) {
+            addCriterion("is_illegal <>", value, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalGreaterThan(Integer value) {
+            addCriterion("is_illegal >", value, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalGreaterThanOrEqualTo(Integer value) {
+            addCriterion("is_illegal >=", value, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalLessThan(Integer value) {
+            addCriterion("is_illegal <", value, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalLessThanOrEqualTo(Integer value) {
+            addCriterion("is_illegal <=", value, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalIn(List<Integer> values) {
+            addCriterion("is_illegal in", values, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalNotIn(List<Integer> values) {
+            addCriterion("is_illegal not in", values, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalBetween(Integer value1, Integer value2) {
+            addCriterion("is_illegal between", value1, value2, "isIllegal");
+            return (Criteria) this;
+        }
+
+        public Criteria andIsIllegalNotBetween(Integer value1, Integer value2) {
+            addCriterion("is_illegal not between", value1, value2, "isIllegal");
+            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 andAuditAccountIsNull() {
+            addCriterion("audit_account is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountIsNotNull() {
+            addCriterion("audit_account is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountEqualTo(String value) {
+            addCriterion("audit_account =", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountNotEqualTo(String value) {
+            addCriterion("audit_account <>", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountGreaterThan(String value) {
+            addCriterion("audit_account >", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountGreaterThanOrEqualTo(String value) {
+            addCriterion("audit_account >=", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountLessThan(String value) {
+            addCriterion("audit_account <", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountLessThanOrEqualTo(String value) {
+            addCriterion("audit_account <=", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountLike(String value) {
+            addCriterion("audit_account like", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountNotLike(String value) {
+            addCriterion("audit_account not like", value, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountIn(List<String> values) {
+            addCriterion("audit_account in", values, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountNotIn(List<String> values) {
+            addCriterion("audit_account not in", values, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountBetween(String value1, String value2) {
+            addCriterion("audit_account between", value1, value2, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditAccountNotBetween(String value1, String value2) {
+            addCriterion("audit_account not between", value1, value2, "auditAccount");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampIsNull() {
+            addCriterion("audit_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampIsNotNull() {
+            addCriterion("audit_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampEqualTo(Long value) {
+            addCriterion("audit_timestamp =", value, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampNotEqualTo(Long value) {
+            addCriterion("audit_timestamp <>", value, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampGreaterThan(Long value) {
+            addCriterion("audit_timestamp >", value, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("audit_timestamp >=", value, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampLessThan(Long value) {
+            addCriterion("audit_timestamp <", value, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("audit_timestamp <=", value, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampIn(List<Long> values) {
+            addCriterion("audit_timestamp in", values, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampNotIn(List<Long> values) {
+            addCriterion("audit_timestamp not in", values, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampBetween(Long value1, Long value2) {
+            addCriterion("audit_timestamp between", value1, value2, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andAuditTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("audit_timestamp not between", value1, value2, "auditTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionIsNull() {
+            addCriterion("score_version is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionIsNotNull() {
+            addCriterion("score_version is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionEqualTo(Byte value) {
+            addCriterion("score_version =", value, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionNotEqualTo(Byte value) {
+            addCriterion("score_version <>", value, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionGreaterThan(Byte value) {
+            addCriterion("score_version >", value, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionGreaterThanOrEqualTo(Byte value) {
+            addCriterion("score_version >=", value, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionLessThan(Byte value) {
+            addCriterion("score_version <", value, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionLessThanOrEqualTo(Byte value) {
+            addCriterion("score_version <=", value, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionIn(List<Byte> values) {
+            addCriterion("score_version in", values, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionNotIn(List<Byte> values) {
+            addCriterion("score_version not in", values, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionBetween(Byte value1, Byte value2) {
+            addCriterion("score_version between", value1, value2, "scoreVersion");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreVersionNotBetween(Byte value1, Byte value2) {
+            addCriterion("score_version not between", value1, value2, "scoreVersion");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 18 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CardServiceImpl.java

@@ -33,6 +33,18 @@ public class CardServiceImpl implements CardService {
     @Autowired
     AigcService aigcService;
 
+    private static final List<String> useShareImgPathList = new ArrayList<String>() {{
+        add("生活之大全");
+        add("生活小优招");
+        add("持家有妙招");
+        add("快乐生活妙技巧");
+        add("麒阁史记");
+        add("趣史论");
+        add("农耕趣时刻");
+        add("退休无忧生活");
+        add("繁花史阁");
+    }};
+
 
     public JSONObject createGzhPath(String videoId, String sharedUid, String ghId, Integer miniProgramType) throws UnsupportedEncodingException {
         String rootShareId = UUID.randomUUID().toString();
@@ -89,7 +101,7 @@ public class CardServiceImpl implements CardService {
     }
 
     public PublishMiniprogram generateSingleCard(Integer index, Integer miniId, VideoDetail videoDetail,
-                                                   PlanAccount planAccount, PublishContent publishContent) throws UnsupportedEncodingException {
+                                                 PlanAccount planAccount, PublishContent publishContent) throws UnsupportedEncodingException {
         String strMiniId = String.valueOf(miniId);
         JSONObject miniInfo = miniProgramMap.getJSONObject(strMiniId);
         String avatar = miniInfo.getString("avatar");
@@ -112,7 +124,11 @@ public class CardServiceImpl implements CardService {
         publishMiniprogram.setVideoId(Long.parseLong(videoId));
         publishMiniprogram.setSource(videoDetail.getSource());
         publishMiniprogram.setVideoTitle(videoDetail.getKimiTitle());
-        publishMiniprogram.setVideoCover(videoDetail.getVideoCover());
+        if (useShareImgPathList.contains(planAccount.getAccountName())) {
+            publishMiniprogram.setVideoCover(videoDetail.getShareImgPath());
+        } else {
+            publishMiniprogram.setVideoCover(videoDetail.getCoverImgPath());
+        }
         publishMiniprogram.setVideoPath(videoDetail.getVideoPath());
         publishMiniprogram.setProductionPath(jsonObject.getString("productionPath"));
         publishMiniprogram.setRootSourceId(jsonObject.getString("rootSourceId"));

+ 4 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java

@@ -287,7 +287,10 @@ public class ContentServiceImpl implements ContentService {
         try {
             CrawlerVideoExample example = new CrawlerVideoExample();
             example.setOrderByClause("score desc");
-            example.createCriteria().andDownloadStatusEqualTo(2).andContentIdEqualTo(publishContent.getSourceId());
+            example.createCriteria().andDownloadStatusEqualTo(2)
+                    .andContentIdEqualTo(publishContent.getSourceId())
+                    .andStatusEqualTo(1)
+                    .andIsIllegalEqualTo(0);
             List<CrawlerVideo> crawlerVideoList = crawlerVideoMapper.selectByExample(example);
             List<CrawlerVideo> videoList = new ArrayList<>();
             if (!CollectionUtils.isEmpty(crawlerVideoList)) {

+ 157 - 33
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -9,7 +9,6 @@ import com.tzld.piaoquan.longarticle.common.enums.SourceTypesEnum;
 import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
-import com.tzld.piaoquan.longarticle.dao.mapper.RootSourceMapper;
 import com.tzld.piaoquan.longarticle.model.bo.MatchContent;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
 import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
@@ -29,7 +28,6 @@ import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
@@ -83,6 +81,126 @@ public class CoreServiceImpl implements CoreService {
     @Autowired
     private AccountService accountService;
 
+    private static final Set<String> miniProgramWhiteList = new HashSet<String>() {{
+        add("生活之大全");
+        add("生活小优招");
+        add("持家有妙招");
+        add("快乐生活妙技巧");
+        add("日常小妙招秘籍");
+        add("日常巧思集");
+        add("日常生活小技巧集");
+        add("那些历史");
+        add("心海情澜起");
+        add("麒阁史记");
+        add("趣史论");
+        add("农耕趣时刻");
+        add("退休无忧生活");
+        add("繁花史阁");
+        add("缘来养心厅");
+        add("史记趣言");
+        add("多彩妙生活");
+        add("家家生活指南");
+        add("历史长河流淌");
+        add("暖心一隅");
+        add("梦游的超级兵");
+
+        add("情感美文一刻");
+        add("趣览史说");
+        add("田耕享生活");
+        add("博阅历史");
+        add("史说新看");
+        add("农家田耕季");
+        add("快乐生活有方法");
+        add("优选持家派");
+        add("趣享谈晚年");
+        add("妙招趣帮手");
+        add("读史趣谈");
+        add("持家优选金点子");
+        add("生活持家派");
+        add("持家有方法");
+        add("文史新看");
+        add("妙读奇闻");
+        add("暮年享乐");
+        add("畅享福晚年");
+        add("趣谈暮年");
+        add("乡土趣享");
+        add("舒誉轶文");
+        add("鸿云念文");
+        add("都市佳人伴渎");
+        add("郸英光语");
+        add("清怡素语");
+        add("岑山旭读");
+        add("杰云若语");
+        add("都市佳人沁读");
+        add("一品趣闻");
+        add("都市佳人蕊读");
+        add("汉史遍览");
+        add("趣史汇看");
+        add("持家有窍门");
+        add("四季田野");
+        add("趣生活技巧");
+        add("无忧居家达人");
+        add("俏持家达人");
+        add("田地杂论");
+        add("趣享晚年");
+        add("少凌雪文");
+        add("妙生活君");
+        add("都市退休蕊渎");
+        add("趣史新看");
+        add("农耕笔记");
+        add("趣闻时分秒");
+        add("持家妙招宝库");
+        add("黄主任谈老来生活");
+        add("理想俏生活");
+        add("田耕生活");
+        add("精选俏生活");
+        add("家有窍门大全");
+        add("窍门天天见");
+        add("退休三缺一");
+        add("快乐生活新方向");
+        add("灵波悦文");
+        add("贝俊逸文");
+        add("田耕杂谈");
+        add("欢乐老来伴");
+        add("彤浩初说");
+        add("观文史说");
+        add("云景史记");
+        add("奇看趣闻");
+        add("乡野地带");
+        add("趣闻汉史");
+        add("香茗史论");
+        add("趣史说说");
+        add("史君记");
+        add("博览史论");
+        add("欢聚暮年");
+        add("妙晚年日记");
+        add("俏生活小妙招");
+        add("轻松妙生活家");
+        add("趣史说");
+        add("兰若浅谈");
+        add("情深花悦");
+        add("暖春畅谈");
+        add("伴你相随");
+        add("爱家常妙招实用");
+        add("生活颂读");
+        add("生活长读");
+        add("生活近读");
+        add("欢乐居家味");
+        add("晚年健读");
+        add("技巧生活艺术家");
+        add("生活先锋事");
+        add("慢读生活");
+        add("生活巧招秘籍馆");
+        add("居家妙招小常识");
+        add("慢读佳文");
+        add("农耕一刻");
+        add("家用妙趣");
+        add("生活凡读");
+        add("生活释读");
+        add("爱家用妙招实用");
+        add("爱家实用妙招");
+        add("福康享生活");
+    }};
     public void initAccountSpecialSettings() {
         List<SpecialSettingVO> specialSettings = aigcService.getSpecialSetting();
         if (CollectionUtils.isEmpty(specialSettings)) {
@@ -619,42 +737,48 @@ public class CoreServiceImpl implements CoreService {
             if (publishContent == null) {
                 continue;
             }
-            //获取小程序
-            List<PublishMiniprogram> publishMiniprogramList = publicContentService.getPublishMiniprograms(publishContent);
-            //不存在则重新生成
-            if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                if (Objects.equals(publishContent.getSourceType(), SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
-                    List<VideoDetail> videoDetails = contentService.getOnlyMiniPublishVideoDetail(publishContent);
-                    log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
-                    if (CollectionUtils.isEmpty(videoDetails)) {
-                        continue;
-                    }
-                    publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
-                    if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                        continue;
-                    }
-                } else {
-                    MatchVideo matchVideo = contentService.getMatchVideo(publishContent, planAccount);
-                    if (matchVideo == null) {
-                        continue;
-                    }
-                    List<VideoDetail> videoDetails = contentService.getPublishVideoDetail(publishContent, planAccount, matchVideo);
-                    log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
-                    if (CollectionUtils.isEmpty(videoDetails)) {
-                        continue;
-                    }
-                    publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
-                    if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                        continue;
+            //临时逻辑 白名单内发小程序
+            boolean isWhiteAccount = miniProgramWhiteList.contains(planAccount.getAccountName());
+            //判断是否插入小程序
+            if (isWhiteAccount && planAccount.getMiniprogramInsertFlag() != null && planAccount.getMiniprogramInsertFlag() == 1) {
+                //获取小程序
+                List<PublishMiniprogram> publishMiniprogramList = publicContentService.getPublishMiniprograms(publishContent);
+                //不存在则重新生成
+                if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                    if (Objects.equals(publishContent.getSourceType(), SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
+                        List<VideoDetail> videoDetails = contentService.getOnlyMiniPublishVideoDetail(publishContent);
+                        log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
+                        if (CollectionUtils.isEmpty(videoDetails)) {
+                            continue;
+                        }
+                        publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
+                        if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                            continue;
+                        }
+                    } else {
+                        MatchVideo matchVideo = contentService.getMatchVideo(publishContent, planAccount);
+                        if (matchVideo == null) {
+                            continue;
+                        }
+                        List<VideoDetail> videoDetails = contentService.getPublishVideoDetail(publishContent, planAccount, matchVideo);
+                        log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
+                        if (CollectionUtils.isEmpty(videoDetails)) {
+                            continue;
+                        }
+                        publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
+                        if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                            continue;
+                        }
+                        contentService.updateMatchContent(publishContent, publishMiniprogramList, matchVideo);
                     }
-                    contentService.updateMatchContent(publishContent, publishMiniprogramList, matchVideo);
                 }
+                log.info("publishMiniprogramList={}", publishMiniprogramList);
+                List<PublishMiniprogramParam> publishCardList = getPublishCardList(publishMiniprogramList);
+                contentParam.setMiniprogramCardList(publishCardList);
             }
+
             sendIds.add(publishContent.getId());
-            log.info("publishMiniprogramList={}", publishMiniprogramList);
-            List<PublishMiniprogramParam> publishCardList = getPublishCardList(publishMiniprogramList);
             contentParam.setPublishContentId(publishContent.getPublishContentId());
-            contentParam.setMiniprogramCardList(publishCardList);
             pushContentList.add(contentParam);
         }
         CreatePushTaskParam gzhPushParam = getCreatePushTaskParam(planAccount, pushContentList);

+ 20 - 7
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoServiceImpl.java

@@ -19,10 +19,7 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 
 import static com.tzld.piaoquan.longarticle.common.constants.RedisConstant.REDIS_COOKIE_KEY;
 
@@ -41,7 +38,6 @@ public class VideoServiceImpl implements VideoService {
     private RedisTemplate<String, Object> redisTemplate;
 
 
-
     public VideoDetail publish(String ossPath, String uid, String title) {
         String videoId = publishToPQ(ossPath, uid, title);
         if (videoId == null) {
@@ -53,7 +49,7 @@ public class VideoServiceImpl implements VideoService {
     private String publishToPQ(String ossPath, String uid, String title) {
         try {
             String cookie = (String) redisTemplate.opsForValue().get(REDIS_COOKIE_KEY);
-            if(StringUtils.isEmpty(cookie)){
+            if (StringUtils.isEmpty(cookie)) {
                 cookie = "JSESSIONID=4DEA2B5173BB9A9E82DB772C0ACDBC9F; JSESSIONID=D02C334150025222A0B824A98B539B78";
             }
             Map<String, Object> payload = new HashMap<>();
@@ -94,6 +90,7 @@ public class VideoServiceImpl implements VideoService {
         return null;
     }
 
+
     private VideoDetail getPQVideoDetail(String videoId) {
         try {
             Map<String, Object> data = new HashMap<>();
@@ -109,11 +106,13 @@ public class VideoServiceImpl implements VideoService {
             if (!CollectionUtils.isEmpty(data)) {
                 String id = list.get(0).getStr("id");
                 String shareImgPath = list.get(0).getStr("shareImgPath");
+                String coverImgPath = getCoverImgPath(shareImgPath);
                 String videoPath = list.get(0).getStr("videoPath");
                 if (StringUtils.isNotEmpty(id)) {
                     videoDetail.setVideoId(id);
                 }
-                videoDetail.setVideoCover(shareImgPath);
+                videoDetail.setShareImgPath(shareImgPath);
+                videoDetail.setCoverImgPath(coverImgPath);
                 videoDetail.setVideoPath(videoPath);
             }
             return videoDetail;
@@ -123,6 +122,20 @@ public class VideoServiceImpl implements VideoService {
         return null;
     }
 
+    private String getCoverImgPath(String shareImgPath) {
+        String[] split = shareImgPath.split("/");
+        StringBuilder stringBuilder = new StringBuilder();
+        for (String s : split) {
+            if (!s.startsWith("watermark")) {
+                stringBuilder.append(s).append("/");
+            }
+        }
+        if (stringBuilder.length() > 0) {
+            stringBuilder.deleteCharAt(stringBuilder.length() - 1);
+        }
+        return stringBuilder.toString();
+    }
+
     @Override
     public void miniProgramVideoOff(String traceId) {
         try {

+ 96 - 7
long-article-server/src/main/resources/mapper/CrawlerVideoMapper.xml

@@ -19,6 +19,11 @@
     <result column="user_id" jdbcType="VARCHAR" property="userId" />
     <result column="trace_id" jdbcType="VARCHAR" property="traceId" />
     <result column="score" jdbcType="REAL" property="score" />
+    <result column="is_illegal" jdbcType="INTEGER" property="isIllegal" />
+    <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="audit_account" jdbcType="VARCHAR" property="auditAccount" />
+    <result column="audit_timestamp" jdbcType="BIGINT" property="auditTimestamp" />
+    <result column="score_version" jdbcType="TINYINT" property="scoreVersion" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.longarticle.model.po.CrawlerVideo">
     <result column="video_url" jdbcType="LONGVARCHAR" property="videoUrl" />
@@ -85,7 +90,7 @@
   <sql id="Base_Column_List">
     id, content_id, out_video_id, platform, video_title, play_count, like_count, share_count, 
     publish_time, crawler_time, duration, download_status, video_oss_path, cover_oss_path, 
-    user_id, trace_id, score
+    user_id, trace_id, score, is_illegal, `status`, audit_account, audit_timestamp, score_version
   </sql>
   <sql id="Blob_Column_List">
     video_url, cover_url
@@ -150,15 +155,19 @@
       like_count, share_count, publish_time, 
       crawler_time, duration, download_status, 
       video_oss_path, cover_oss_path, user_id, 
-      trace_id, score, video_url, 
-      cover_url)
+      trace_id, score, is_illegal, 
+      `status`, audit_account, audit_timestamp, 
+      score_version, video_url, cover_url
+      )
     values (#{id,jdbcType=INTEGER}, #{contentId,jdbcType=VARCHAR}, #{outVideoId,jdbcType=VARCHAR}, 
       #{platform,jdbcType=VARCHAR}, #{videoTitle,jdbcType=VARCHAR}, #{playCount,jdbcType=INTEGER}, 
       #{likeCount,jdbcType=INTEGER}, #{shareCount,jdbcType=INTEGER}, #{publishTime,jdbcType=TIMESTAMP}, 
       #{crawlerTime,jdbcType=TIMESTAMP}, #{duration,jdbcType=INTEGER}, #{downloadStatus,jdbcType=INTEGER}, 
       #{videoOssPath,jdbcType=VARCHAR}, #{coverOssPath,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, 
-      #{traceId,jdbcType=VARCHAR}, #{score,jdbcType=REAL}, #{videoUrl,jdbcType=LONGVARCHAR}, 
-      #{coverUrl,jdbcType=LONGVARCHAR})
+      #{traceId,jdbcType=VARCHAR}, #{score,jdbcType=REAL}, #{isIllegal,jdbcType=INTEGER}, 
+      #{status,jdbcType=INTEGER}, #{auditAccount,jdbcType=VARCHAR}, #{auditTimestamp,jdbcType=BIGINT}, 
+      #{scoreVersion,jdbcType=TINYINT}, #{videoUrl,jdbcType=LONGVARCHAR}, #{coverUrl,jdbcType=LONGVARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.CrawlerVideo">
     insert into long_articles_crawler_videos
@@ -214,6 +223,21 @@
       <if test="score != null">
         score,
       </if>
+      <if test="isIllegal != null">
+        is_illegal,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="auditAccount != null">
+        audit_account,
+      </if>
+      <if test="auditTimestamp != null">
+        audit_timestamp,
+      </if>
+      <if test="scoreVersion != null">
+        score_version,
+      </if>
       <if test="videoUrl != null">
         video_url,
       </if>
@@ -273,6 +297,21 @@
       <if test="score != null">
         #{score,jdbcType=REAL},
       </if>
+      <if test="isIllegal != null">
+        #{isIllegal,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="auditAccount != null">
+        #{auditAccount,jdbcType=VARCHAR},
+      </if>
+      <if test="auditTimestamp != null">
+        #{auditTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="scoreVersion != null">
+        #{scoreVersion,jdbcType=TINYINT},
+      </if>
       <if test="videoUrl != null">
         #{videoUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -341,6 +380,21 @@
       <if test="record.score != null">
         score = #{record.score,jdbcType=REAL},
       </if>
+      <if test="record.isIllegal != null">
+        is_illegal = #{record.isIllegal,jdbcType=INTEGER},
+      </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
+      <if test="record.auditAccount != null">
+        audit_account = #{record.auditAccount,jdbcType=VARCHAR},
+      </if>
+      <if test="record.auditTimestamp != null">
+        audit_timestamp = #{record.auditTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="record.scoreVersion != null">
+        score_version = #{record.scoreVersion,jdbcType=TINYINT},
+      </if>
       <if test="record.videoUrl != null">
         video_url = #{record.videoUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -371,6 +425,11 @@
       user_id = #{record.userId,jdbcType=VARCHAR},
       trace_id = #{record.traceId,jdbcType=VARCHAR},
       score = #{record.score,jdbcType=REAL},
+      is_illegal = #{record.isIllegal,jdbcType=INTEGER},
+      `status` = #{record.status,jdbcType=INTEGER},
+      audit_account = #{record.auditAccount,jdbcType=VARCHAR},
+      audit_timestamp = #{record.auditTimestamp,jdbcType=BIGINT},
+      score_version = #{record.scoreVersion,jdbcType=TINYINT},
       video_url = #{record.videoUrl,jdbcType=LONGVARCHAR},
       cover_url = #{record.coverUrl,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
@@ -395,7 +454,12 @@
       cover_oss_path = #{record.coverOssPath,jdbcType=VARCHAR},
       user_id = #{record.userId,jdbcType=VARCHAR},
       trace_id = #{record.traceId,jdbcType=VARCHAR},
-      score = #{record.score,jdbcType=REAL}
+      score = #{record.score,jdbcType=REAL},
+      is_illegal = #{record.isIllegal,jdbcType=INTEGER},
+      `status` = #{record.status,jdbcType=INTEGER},
+      audit_account = #{record.auditAccount,jdbcType=VARCHAR},
+      audit_timestamp = #{record.auditTimestamp,jdbcType=BIGINT},
+      score_version = #{record.scoreVersion,jdbcType=TINYINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -451,6 +515,21 @@
       <if test="score != null">
         score = #{score,jdbcType=REAL},
       </if>
+      <if test="isIllegal != null">
+        is_illegal = #{isIllegal,jdbcType=INTEGER},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="auditAccount != null">
+        audit_account = #{auditAccount,jdbcType=VARCHAR},
+      </if>
+      <if test="auditTimestamp != null">
+        audit_timestamp = #{auditTimestamp,jdbcType=BIGINT},
+      </if>
+      <if test="scoreVersion != null">
+        score_version = #{scoreVersion,jdbcType=TINYINT},
+      </if>
       <if test="videoUrl != null">
         video_url = #{videoUrl,jdbcType=LONGVARCHAR},
       </if>
@@ -478,6 +557,11 @@
       user_id = #{userId,jdbcType=VARCHAR},
       trace_id = #{traceId,jdbcType=VARCHAR},
       score = #{score,jdbcType=REAL},
+      is_illegal = #{isIllegal,jdbcType=INTEGER},
+      `status` = #{status,jdbcType=INTEGER},
+      audit_account = #{auditAccount,jdbcType=VARCHAR},
+      audit_timestamp = #{auditTimestamp,jdbcType=BIGINT},
+      score_version = #{scoreVersion,jdbcType=TINYINT},
       video_url = #{videoUrl,jdbcType=LONGVARCHAR},
       cover_url = #{coverUrl,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=INTEGER}
@@ -499,7 +583,12 @@
       cover_oss_path = #{coverOssPath,jdbcType=VARCHAR},
       user_id = #{userId,jdbcType=VARCHAR},
       trace_id = #{traceId,jdbcType=VARCHAR},
-      score = #{score,jdbcType=REAL}
+      score = #{score,jdbcType=REAL},
+      is_illegal = #{isIllegal,jdbcType=INTEGER},
+      `status` = #{status,jdbcType=INTEGER},
+      audit_account = #{auditAccount,jdbcType=VARCHAR},
+      audit_timestamp = #{auditTimestamp,jdbcType=BIGINT},
+      score_version = #{scoreVersion,jdbcType=TINYINT}
     where id = #{id,jdbcType=INTEGER}
   </update>
 </mapper>

+ 1 - 1
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -60,7 +60,7 @@
 <!--            <columnOverride column="cover_url" javaType="java.lang.String" jdbcType="LONGVARCHAR" />-->
 <!--        </table>-->
 <!--        <table tableName="long_articles_root_source_id" domainObjectName="RootSource" alias=""/>-->
-        <table tableName="long_articles_account_special_settings" domainObjectName="AccountSpecialSettings" alias=""/>
+        <table tableName="long_articles_crawler_videos" domainObjectName="CrawlerVideo" alias=""/>
 <!--            <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
 
 <!--                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->