Parcourir la source

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

xueyiming il y a 5 mois
Parent
commit
71da7c3dcd

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

@@ -33,7 +33,9 @@ public class CardServiceImpl implements CardService {
     @Autowired
     AigcService aigcService;
 
-    private static final List<String> useShareImgPathList = new ArrayList<String>();
+    private static final List<String> useShareImgPathList = new ArrayList<String>(){{
+        add("20250208065525959973866");
+    }};
 
 
     public JSONObject createGzhPath(String videoId, String sharedUid, String ghId, Integer miniProgramType) throws UnsupportedEncodingException {
@@ -114,7 +116,7 @@ public class CardServiceImpl implements CardService {
         publishMiniprogram.setVideoId(Long.parseLong(videoId));
         publishMiniprogram.setSource(videoDetail.getSource());
         publishMiniprogram.setVideoTitle(videoDetail.getKimiTitle());
-        if (useShareImgPathList.contains(planAccount.getAccountName())) {
+        if (useShareImgPathList.contains(planAccount.getPlanId())) {
             publishMiniprogram.setVideoCover(videoDetail.getShareImgPath());
         } else {
             publishMiniprogram.setVideoCover(videoDetail.getCoverImgPath());

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

@@ -76,7 +76,7 @@ public class ContentServiceImpl implements ContentService {
         publishMatchContentMapper.insertSelective(publishMatchContent);
     }
 
-    public MatchVideo  getContent(String contentId, String ghId, Integer publishFlag) {
+    public MatchVideo getContent(String contentId, String ghId, Integer publishFlag) {
         MatchVideoExample matchVideoExample = new MatchVideoExample();
         matchVideoExample.createCriteria().andGhIdEqualTo(ghId).andContentIdEqualTo(contentId)
                 .andPublishFlagEqualTo(publishFlag);
@@ -217,8 +217,8 @@ public class ContentServiceImpl implements ContentService {
         return data.getRank_list();
     }
 
-    public List<VideoDetail> getPublishVideoDetail(MatchVideo matchVideo, Integer publicFlag) {
-        List<CrawlerVideo> contentMiniVideos = getContentMiniVideo(matchVideo.getContentId(), publicFlag);
+    public List<VideoDetail> getPublishVideoDetail(MatchVideo matchVideo, Integer publicFlag, PlanAccount planAccount) {
+        List<CrawlerVideo> contentMiniVideos = getContentMiniVideo(matchVideo.getContentId(), publicFlag, planAccount);
         log.info("getPublishVideoDetail contentMiniVideos={}", contentMiniVideos);
         if (CollectionUtils.isEmpty(contentMiniVideos)) {
             LarkRobotUtil.sendMessage("文章获取小程序为空 matchVideo.getContentId" + matchVideo.getContentId());
@@ -285,7 +285,7 @@ public class ContentServiceImpl implements ContentService {
     }
 
 
-    public List<CrawlerVideo> getContentMiniVideo(String contentId, Integer publicFlag) {
+    public List<CrawlerVideo> getContentMiniVideo(String contentId, Integer publicFlag, PlanAccount planAccount) {
         try {
             CrawlerVideoExample example = new CrawlerVideoExample();
             example.setOrderByClause("score desc");
@@ -296,6 +296,16 @@ public class ContentServiceImpl implements ContentService {
                 criteria.andStatusEqualTo(1).andIsIllegalEqualTo(0);
             }
             List<CrawlerVideo> crawlerVideoList = crawlerVideoMapper.selectByExample(example);
+            if (planAccount == null) {
+                return crawlerVideoList;
+            }
+            //临时逻辑  该计划返回正常数量小程序
+            if ("20250208065525959973866".equals(planAccount.getPlanId())) {
+                if (crawlerVideoList.size() > 3) {
+                    return crawlerVideoList.subList(0, 3);
+                }
+                return crawlerVideoList;
+            }
             List<CrawlerVideo> videoList = new ArrayList<>();
             if (!CollectionUtils.isEmpty(crawlerVideoList)) {
                 videoList.add(crawlerVideoList.get(0));

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

@@ -1263,7 +1263,7 @@ public class CoreServiceImpl implements CoreService {
                             continue;
                         }
                         List<VideoDetail> videoDetails = contentService.
-                                getPublishVideoDetail(matchVideo, PublicFlagEnum.NOT_PUBLIC.getStatusCode());
+                                getPublishVideoDetail(matchVideo, PublicFlagEnum.NOT_PUBLIC.getStatusCode(),planAccount);
                         log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
                         if (CollectionUtils.isEmpty(videoDetails)) {
                             continue;

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

@@ -503,7 +503,7 @@ public class MatchVideoServiceImpl {
     }
 
     public void processPublishCrawlerVideo(MatchVideo matchVideo) {
-        List<VideoDetail> videoDetails = contentService.getPublishVideoDetail(matchVideo, PublicFlagEnum.PUBLIC.getStatusCode());
+        List<VideoDetail> videoDetails = contentService.getPublishVideoDetail(matchVideo, PublicFlagEnum.PUBLIC.getStatusCode(), null);
         if (CollectionUtils.isEmpty(videoDetails)) {
             return;
         }