xueyiming 8 месяцев назад
Родитель
Сommit
1885231292
28 измененных файлов с 187 добавлено и 169 удалено
  1. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/PlanAccountJob.java
  2. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/CardService.java
  3. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/ContentService.java
  4. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/CoverService.java
  5. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/MatchVideoService.java
  6. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/PlanService.java
  7. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/PublishService.java
  8. 0 4
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/SortService.java
  9. 0 37
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/CoverServiceImpl.java
  10. 4 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/CardService.java
  11. 4 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/ContentService.java
  12. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/CoreService.java
  13. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/KimiService.java
  14. 4 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/MatchVideoService.java
  15. 8 15
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CardServiceImpl.java
  16. 7 28
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java
  17. 25 23
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java
  18. 2 2
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/KimiServiceImpl.java
  19. 3 3
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/MatchVideoServiceImpl.java
  20. 1 8
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/PlanAccountServiceImpl.java
  21. 24 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/AigcService.java
  22. 8 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/MatchService.java
  23. 9 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/SortService.java
  24. 8 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/VideoService.java
  25. 32 8
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java
  26. 34 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/MatchServiceImpl.java
  27. 3 3
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/SortServiceImpl.java
  28. 8 11
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoServiceImpl.java

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/PlanAccountJob.java

@@ -1,6 +1,6 @@
 package com.tzld.piaoquan.longarticle.job;
 
-import com.tzld.piaoquan.longarticle.service.impl.CoreServiceImpl;
+import com.tzld.piaoquan.longarticle.service.local.impl.CoreServiceImpl;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/CardService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface CardService {
-}

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/ContentService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface ContentService {
-}

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/CoverService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface CoverService {
-}

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/MatchVideoService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface MatchVideoService {
-}

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/PlanService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface PlanService {
-}

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/PublishService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface PublishService {
-}

+ 0 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/SortService.java

@@ -1,4 +0,0 @@
-package com.tzld.piaoquan.longarticle.service;
-
-public interface SortService {
-}

+ 0 - 37
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/CoverServiceImpl.java

@@ -1,37 +0,0 @@
-package com.tzld.piaoquan.longarticle.service.impl;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.tzld.piaoquan.longarticle.service.CoverService;
-import com.tzld.piaoquan.longarticle.utils.HttpClientUtil;
-import com.tzld.piaoquan.longarticle.utils.HttpPoolClientUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.stereotype.Service;
-
-@Slf4j
-@Service
-public class CoverServiceImpl implements CoverService {
-
-    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 5000, 20, 100, 3, 3000);
-
-
-    public String pushCover(String coverUrl, String publishContentId) {
-        String apiUrl = "http://aigc-api.cybertogether.net/aigc//publish/LongArticleSystem/uploadMiniprogramCover";
-        try {
-            JSONObject param = new JSONObject();
-            param.put("coverUrl", coverUrl);
-            param.put("publishContentId", publishContentId);
-            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSONObject.toJSONString(param));
-            JSONObject jsonObject = JSON.parseObject(res);
-            Integer code = jsonObject.getInteger("code");
-            if (code == 0) {
-                JSONObject data = jsonObject.getJSONObject("data");
-                return data.getString("wxUrl");
-            }
-            return null;
-        } catch (Exception e) {
-            log.error("getAllLongArticleSystemPlan error", e);
-        }
-        return null;
-    }
-}

+ 4 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/CardService.java

@@ -0,0 +1,4 @@
+package com.tzld.piaoquan.longarticle.service.local;
+
+public interface CardService {
+}

+ 4 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/ContentService.java

@@ -0,0 +1,4 @@
+package com.tzld.piaoquan.longarticle.service.local;
+
+public interface ContentService {
+}

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

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.longarticle.service;
+package com.tzld.piaoquan.longarticle.service.local;
 
 public interface CoreService {
 

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

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.longarticle.service;
+package com.tzld.piaoquan.longarticle.service.local;
 
 import com.tzld.piaoquan.longarticle.model.po.LongArticlesText;
 

+ 4 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/MatchVideoService.java

@@ -0,0 +1,4 @@
+package com.tzld.piaoquan.longarticle.service.local;
+
+public interface MatchVideoService {
+}

+ 8 - 15
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/CardServiceImpl.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CardServiceImpl.java

@@ -1,18 +1,15 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.local.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
 import com.tzld.piaoquan.longarticle.model.po.PublishMiniprogram;
-import com.tzld.piaoquan.longarticle.model.vo.PublishMiniprogramParam;
-import com.tzld.piaoquan.longarticle.service.CardService;
+import com.tzld.piaoquan.longarticle.service.local.CardService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import org.springframework.util.StringUtils;
 
 import java.io.UnsupportedEncodingException;
-import java.math.BigDecimal;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
@@ -26,14 +23,10 @@ public class CardServiceImpl implements CardService {
     @ApolloJsonValue("${miniMap:{}}")
     private JSONObject miniProgramMap;
 
-    @Autowired
-    CoverServiceImpl coverService;
-
 
     public JSONObject createGzhPath(String videoId, String sharedUid, String ghId, Integer miniProgramType) throws UnsupportedEncodingException {
         String rootShareId = UUID.randomUUID().toString();
         String rootSourceId;
-
         switch (miniProgramType) {
             case 1:
                 rootSourceId = "longArticles_" + generateSourceId();
@@ -115,22 +108,22 @@ public class CardServiceImpl implements CardService {
 
     public List<PublishMiniprogram> generateCards(Long planAccountId, String ghId, List<VideoDetail> videoDetails, int miniProgramType, String publishContentId) {
         try {
-            int long_articles_mini_program_id = 25;
-            int touliu_mini_program_id = 33;
-            int we_com_mini_program_id = 27;
+            int longArticlesMiniProgramId = 25;
+            int touliuMiniProgramId = 33;
+            int weComMiniProgramId = 27;
             int miniId = 0;
 
             List<PublishMiniprogram> cardList = new ArrayList<>();
 
             switch (miniProgramType) {
                 case 1:
-                    miniId = long_articles_mini_program_id;
+                    miniId = longArticlesMiniProgramId;
                     break;
                 case 2:
-                    miniId = touliu_mini_program_id;
+                    miniId = touliuMiniProgramId;
                     break;
                 case 3:
-                    miniId = we_com_mini_program_id;
+                    miniId = weComMiniProgramId;
                     break;
                 default:
                     break;

+ 7 - 28
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/ContentServiceImpl.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java

@@ -1,31 +1,26 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.local.impl;
 
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.piaoquan.longarticle.dao.mapper.CrawlerVideoMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.MatchVideoMapper;
-import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
 import com.tzld.piaoquan.longarticle.model.po.CrawlerVideo;
 import com.tzld.piaoquan.longarticle.model.po.CrawlerVideoExample;
 import com.tzld.piaoquan.longarticle.model.po.MatchVideo;
 import com.tzld.piaoquan.longarticle.model.po.MatchVideoExample;
-import com.tzld.piaoquan.longarticle.model.vo.ContentItemVO;
-import com.tzld.piaoquan.longarticle.service.ContentService;
-import com.tzld.piaoquan.longarticle.utils.*;
+import com.tzld.piaoquan.longarticle.service.local.ContentService;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
 
 @Slf4j
 @Service
 public class ContentServiceImpl implements ContentService {
-
-    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 5000, 20, 100, 3, 3000);
-
     @ApolloJsonValue("${testAccountLevel2:{}}")
     private Map<String, Integer> ghIdMap;
 
@@ -35,22 +30,6 @@ public class ContentServiceImpl implements ContentService {
     @Autowired
     private CrawlerVideoMapper crawlerVideoMapper;
 
-    public boolean matchMiniprogramVideo(MiniprogramCardRequest request) {
-        String apiUrl = "http://47.99.132.47:8111/search_videos";
-        List<ContentItemVO> contentItemList = new ArrayList<>();
-        try {
-            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(request));
-            JSONObject jsonObject = JSON.parseObject(res);
-            Integer code = jsonObject.getInteger("code");
-            if (code == 0) {
-                return true;
-            }
-        } catch (Exception e) {
-            log.error("submitMiniprogramCard error", e);
-        }
-        return false;
-    }
-
     public MatchVideo getContent(String contentId, String ghId) {
         MatchVideoExample matchVideoExample = new MatchVideoExample();
         matchVideoExample.createCriteria().andGhIdEqualTo(ghId).andContentIdEqualTo(contentId);
@@ -62,7 +41,7 @@ public class ContentServiceImpl implements ContentService {
     }
 
 
-    public List<CrawlerVideo> getContentVideo(String contentId, String flowPoolLevel, String ghId) {
+    public List<CrawlerVideo> getContentMiniVideo(String contentId, String flowPoolLevel, String ghId) {
         CrawlerVideoExample example = new CrawlerVideoExample();
         example.setOrderByClause("score desc");
         example.createCriteria().andDownloadStatusEqualTo(2).andContentIdEqualTo(contentId);

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

@@ -1,18 +1,20 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.local.impl;
 
 import com.alibaba.fastjson.JSON;
-import com.google.common.collect.Lists;
 import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
 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.VideoDetail;
 import com.tzld.piaoquan.longarticle.model.dto.*;
-import com.tzld.piaoquan.longarticle.model.bo.*;
 import com.tzld.piaoquan.longarticle.model.po.*;
-import com.tzld.piaoquan.longarticle.model.po.PlanAccount;
 import com.tzld.piaoquan.longarticle.model.vo.*;
-import com.tzld.piaoquan.longarticle.service.CoreService;
+import com.tzld.piaoquan.longarticle.service.local.CoreService;
+import com.tzld.piaoquan.longarticle.service.remote.AigcService;
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
+import com.tzld.piaoquan.longarticle.service.remote.VideoService;
+import com.tzld.piaoquan.longarticle.service.remote.impl.SortServiceImpl;
 import com.tzld.piaoquan.longarticle.utils.DateUtil;
 import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
 import com.tzld.piaoquan.longarticle.utils.TimeZoneUtil;
@@ -32,7 +34,7 @@ import java.util.stream.Collectors;
 public class CoreServiceImpl implements CoreService {
 
     @Autowired
-    private PlanServiceImpl planService;
+    private AigcService aigcService;
 
     @Autowired
     private SortServiceImpl sortService;
@@ -41,16 +43,16 @@ public class CoreServiceImpl implements CoreService {
     private ContentServiceImpl contentService;
 
     @Autowired
-    private PublishServiceImpl publishService;
+    private MatchService matchService;
 
     @Autowired
-    private KimiServiceImpl kimiService;
+    private VideoService videoService;
 
     @Autowired
-    private CardServiceImpl cardService;
+    private KimiServiceImpl kimiService;
 
     @Autowired
-    private CoverServiceImpl coverService;
+    private CardServiceImpl cardService;
 
     @Autowired
     private PlanAccountMapper planAccountMapper;
@@ -69,7 +71,7 @@ public class CoreServiceImpl implements CoreService {
 
     @Override
     public void initPlanAccount() {
-        List<LongArticleSystemPlan> allLongArticleSystemPlans = planService.getAllLongArticleSystemPlan();
+        List<LongArticleSystemPlan> allLongArticleSystemPlans = aigcService.getAllLongArticleSystemPlan();
         for (LongArticleSystemPlan longArticleSystemPlan : allLongArticleSystemPlans) {
             if (longArticleSystemPlan.getPublishRate() == 1) {
                 List<Integer> weeks = JSON.parseArray(longArticleSystemPlan.getPublishDate(), Integer.class);
@@ -149,7 +151,7 @@ public class CoreServiceImpl implements CoreService {
             LongArticleSystemGetContentsParam param = new LongArticleSystemGetContentsParam();
             param.setAccountId(planAccount.getAccountId());
             param.setPlanId(planAccount.getPlanId());
-            LongArticleSystemContentVO longArticleSystemContentVO = planService.getContentItemList(param);
+            LongArticleSystemContentVO longArticleSystemContentVO = aigcService.getContentItemList(param);
             if (longArticleSystemContentVO == null) {
                 continue;
             }
@@ -166,7 +168,7 @@ public class CoreServiceImpl implements CoreService {
                         MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
                         statusParam.setStatus(2);
                         statusParam.setPublishContentId(contentItemVO.getPublishContentId());
-                        planService.updateMatchMiniprogramStatus(statusParam);
+                        aigcService.updateMatchMiniprogramStatus(statusParam);
                         continue;
                     }
                     if (contentStatus == 99 || contentStatus == 97) {
@@ -179,7 +181,7 @@ public class CoreServiceImpl implements CoreService {
                         if (contentStatus == 97) {
                             statusParam.setErrorMsg("文章晋级或者退场");
                         }
-                        planService.updateMatchMiniprogramStatus(statusParam);
+                        aigcService.updateMatchMiniprogramStatus(statusParam);
                     }
                 } else {
                     MiniprogramCardRequest request = new MiniprogramCardRequest();
@@ -191,7 +193,7 @@ public class CoreServiceImpl implements CoreService {
                     request.setStrategy("strategy_v2");
                     request.setArticleId(contentItemVO.getSourceId());
                     request.setFlowPoolLevelTag(contentItemVO.getFlowPoolLevelTag());
-                    contentService.matchMiniprogramVideo(request);
+                    matchService.matchMiniprogramVideo(request);
                 }
             }
         }
@@ -328,7 +330,7 @@ public class CoreServiceImpl implements CoreService {
                 }
                 FilterSortParam param = new FilterSortParam();
                 param.setFilterSortContentList(list);
-                planService.filterSortContents(param);
+                aigcService.filterSortContents(param);
             }
             List<LongArticleSystemPushContentParam> pushContentList = new ArrayList<>();
             //排序结束
@@ -347,7 +349,7 @@ public class CoreServiceImpl implements CoreService {
                 sendIds.add(publishContent.getId());
                 //获取小程序
                 List<CrawlerVideo> contentVideos =
-                        contentService.getContentVideo(publishArticleData.getSourceId(), publishArticleData.getContentPoolType(), planAccount.getGhId());
+                        contentService.getContentMiniVideo(publishArticleData.getSourceId(), publishArticleData.getContentPoolType(), planAccount.getGhId());
                 List<VideoDetail> videoDetails = new ArrayList<>();
                 //发布小程序
                 for (CrawlerVideo crawlerVideo : contentVideos) {
@@ -362,7 +364,7 @@ public class CoreServiceImpl implements CoreService {
                     } else {
                         kimiTitle = crawlerVideo.getVideoTitle();
                     }
-                    VideoDetail publish = publishService.publish(videoOssPath, userId, kimiTitle, platform, traceId);
+                    VideoDetail publish = videoService.publish(videoOssPath, userId, kimiTitle, platform, traceId);
                     if (publish == null) {
                         continue;
                     }
@@ -373,7 +375,7 @@ public class CoreServiceImpl implements CoreService {
                     statusParam.setStatus(3);
                     statusParam.setPublishContentId(publishContentId);
                     statusParam.setErrorMsg("小程序视频数量不足");
-                    planService.updateMatchMiniprogramStatus(statusParam);
+                    aigcService.updateMatchMiniprogramStatus(statusParam);
 
                     PublishContent update = new PublishContent();
                     update.setId(publishContent.getId());
@@ -391,7 +393,7 @@ public class CoreServiceImpl implements CoreService {
                 List<PublishMiniprogramParam> publishCardList = new ArrayList<>();
                 for (PublishMiniprogram publishMiniprogram : cardList) {
                     String videoCover = publishMiniprogram.getVideoCover();
-                    String wxUrl = coverService.pushCover(videoCover, publishMiniprogram.getPublishContentId());
+                    String wxUrl = aigcService.pushCover(videoCover, publishMiniprogram.getPublishContentId());
                     if (StringUtils.isEmpty(wxUrl)) {
                         continue;
                     }
@@ -439,7 +441,7 @@ public class CoreServiceImpl implements CoreService {
                     statusParam.setStatus(3);
                     statusParam.setPublishContentId(publishContentId);
                     statusParam.setErrorMsg("小程序视频数量不足");
-                    planService.updateMatchMiniprogramStatus(statusParam);
+                    aigcService.updateMatchMiniprogramStatus(statusParam);
 
                     PublishContent update = new PublishContent();
                     update.setId(publishContent.getId());
@@ -469,7 +471,7 @@ public class CoreServiceImpl implements CoreService {
                 continue;
             }
             log.info("gzhPushParam={}", gzhPushParam);
-            String pushId = planService.createPushTask(gzhPushParam);
+            String pushId = aigcService.createPushTask(gzhPushParam);
             log.info("pushId = {}", pushId);
             if (StringUtils.isNotEmpty(pushId)) {
                 for (Long id : sendIds) {
@@ -496,7 +498,7 @@ public class CoreServiceImpl implements CoreService {
         for (String pushId : collect) {
             PushStatusParam param = new PushStatusParam();
             param.setPushId(pushId);
-            PushStatusVO pushStatusVO = planService.queryPushStatus(param);
+            PushStatusVO pushStatusVO = aigcService.queryPushStatus(param);
             if (pushStatusVO == null) {
                 continue;
             }

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

@@ -1,9 +1,9 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.local.impl;
 
 import com.tzld.piaoquan.longarticle.dao.mapper.LongArticlesTextMapper;
 import com.tzld.piaoquan.longarticle.model.po.LongArticlesText;
 import com.tzld.piaoquan.longarticle.model.po.LongArticlesTextExample;
-import com.tzld.piaoquan.longarticle.service.KimiService;
+import com.tzld.piaoquan.longarticle.service.local.KimiService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;

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

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.local.impl;
 
 import cn.hutool.json.JSONObject;
 import com.alibaba.fastjson.JSONArray;
@@ -6,8 +6,8 @@ import com.tzld.piaoquan.longarticle.dao.mapper.CrawlerVideoMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.MatchVideoMapper;
 import com.tzld.piaoquan.longarticle.model.po.*;
 import com.tzld.piaoquan.longarticle.model.vo.MatchVideoVo;
-import com.tzld.piaoquan.longarticle.service.KimiService;
-import com.tzld.piaoquan.longarticle.service.MatchVideoService;
+import com.tzld.piaoquan.longarticle.service.local.KimiService;
+import com.tzld.piaoquan.longarticle.service.local.MatchVideoService;
 import com.tzld.piaoquan.longarticle.utils.*;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;

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

@@ -1,4 +1,4 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.local.impl;
 
 import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.model.po.PlanAccount;
@@ -11,13 +11,6 @@ public class PlanAccountServiceImpl {
     @Autowired
     private PlanAccountMapper planAccountMapper;
 
-    public void updateStatus(Integer status, Long id) {
-        PlanAccount updatePlanAccount = new PlanAccount();
-        updatePlanAccount.setId(id);
-        updatePlanAccount.setStatus(status);
-        planAccountMapper.updateByPrimaryKey(updatePlanAccount);
-    }
-
     public void updateMatchStatus(Integer status, Long id) {
         PlanAccount updatePlanAccount = new PlanAccount();
         updatePlanAccount.setId(id);

+ 24 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/AigcService.java

@@ -0,0 +1,24 @@
+package com.tzld.piaoquan.longarticle.service.remote;
+
+import com.tzld.piaoquan.longarticle.model.vo.*;
+
+import java.util.List;
+
+public interface AigcService {
+
+    List<LongArticleSystemPlan> getAllLongArticleSystemPlan();
+
+    LongArticleSystemContentVO getContentItemList(LongArticleSystemGetContentsParam param);
+
+    LongArticleSystemContentVO listWaitingMatchMiniprogramContents(LongArticleSystemGetContentsParam param);
+
+    String createPushTask(LongArticleSystemCreatePushTaskParam param);
+
+    boolean updateMatchMiniprogramStatus(MatchMiniprogramStatusParam param);
+
+    boolean filterSortContents(FilterSortParam param);
+
+    PushStatusVO queryPushStatus(PushStatusParam param);
+
+    String pushCover(String coverUrl, String publishContentId);
+}

+ 8 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/MatchService.java

@@ -0,0 +1,8 @@
+package com.tzld.piaoquan.longarticle.service.remote;
+
+import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
+
+public interface MatchService {
+
+    boolean matchMiniprogramVideo(MiniprogramCardRequest request);
+}

+ 9 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/SortService.java

@@ -0,0 +1,9 @@
+package com.tzld.piaoquan.longarticle.service.remote;
+
+import com.tzld.piaoquan.longarticle.model.dto.ArticleSortRequest;
+import com.tzld.piaoquan.longarticle.model.dto.ArticleSortResponse;
+
+public interface SortService {
+
+    ArticleSortResponse publishArticleSort(ArticleSortRequest request);
+}

+ 8 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/VideoService.java

@@ -0,0 +1,8 @@
+package com.tzld.piaoquan.longarticle.service.remote;
+
+import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
+
+public interface VideoService {
+
+    VideoDetail publish(String ossPath, String uid, String title, String platform, String traceId);
+}

+ 32 - 8
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/PlanServiceImpl.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java

@@ -1,26 +1,26 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.remote.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.longarticle.model.vo.LongArticleSystemPlan;
 import com.tzld.piaoquan.longarticle.model.vo.*;
+import com.tzld.piaoquan.longarticle.service.remote.AigcService;
 import com.tzld.piaoquan.longarticle.utils.HttpClientUtil;
 import com.tzld.piaoquan.longarticle.utils.HttpPoolClientUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
-import java.util.ArrayList;
 import java.util.List;
 
 @Slf4j
 @Service
-public class PlanServiceImpl {
+public class AigcServiceImpl implements AigcService {
 
     private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 5000, 20, 100, 3, 3000);
 
-
+    @Override
     //获取所有长文系统托管计划
     public List<LongArticleSystemPlan> getAllLongArticleSystemPlan() {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/getAllLongArticleSystemPlan";
@@ -30,8 +30,7 @@ public class PlanServiceImpl {
             Integer code = jsonObject.getInteger("code");
             if (code == 0) {
                 JSONArray data = jsonObject.getJSONArray("data");
-                List<LongArticleSystemPlan> list = data.toJavaList(LongArticleSystemPlan.class);
-                return list;
+                return data.toJavaList(LongArticleSystemPlan.class);
             }
             return null;
         } catch (Exception e) {
@@ -40,6 +39,7 @@ public class PlanServiceImpl {
         return null;
     }
 
+    @Override
     public LongArticleSystemContentVO getContentItemList(LongArticleSystemGetContentsParam param) {
         int pageNum = 1;
         int pageSize = 500;
@@ -61,6 +61,7 @@ public class PlanServiceImpl {
         return longArticleSystemContentVO;
     }
 
+    @Override
     //分页获取待排序内容列表
     public LongArticleSystemContentVO listWaitingMatchMiniprogramContents(LongArticleSystemGetContentsParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/listWaitingMatchMiniprogramContents";
@@ -77,6 +78,7 @@ public class PlanServiceImpl {
         return null;
     }
 
+    @Override
     //创建推送任务
     public String createPushTask(LongArticleSystemCreatePushTaskParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/createPushTask";
@@ -93,6 +95,7 @@ public class PlanServiceImpl {
         return "";
     }
 
+    @Override
     //更新匹配小程序状态
     public boolean updateMatchMiniprogramStatus(MatchMiniprogramStatusParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/updateMatchMiniprogramStatus";
@@ -109,9 +112,9 @@ public class PlanServiceImpl {
         return false;
     }
 
+    @Override
     public boolean filterSortContents(FilterSortParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/filterSortContents";
-        List<ContentItemVO> contentItemList = new ArrayList<>();
         try {
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
@@ -125,9 +128,9 @@ public class PlanServiceImpl {
         return false;
     }
 
+    @Override
     public PushStatusVO queryPushStatus(PushStatusParam param) {
         String apiUrl = "http://aigc-api.cybertogether.net/aigc/publish/LongArticleSystem/queryPushStatus";
-        List<ContentItemVO> contentItemList = new ArrayList<>();
         try {
             String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
             JSONObject jsonObject = JSON.parseObject(res);
@@ -141,4 +144,25 @@ public class PlanServiceImpl {
         }
         return null;
     }
+
+    @Override
+    public String pushCover(String coverUrl, String publishContentId) {
+        String apiUrl = "http://aigc-api.cybertogether.net/aigc//publish/LongArticleSystem/uploadMiniprogramCover";
+        try {
+            JSONObject param = new JSONObject();
+            param.put("coverUrl", coverUrl);
+            param.put("publishContentId", publishContentId);
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSONObject.toJSONString(param));
+            JSONObject jsonObject = JSON.parseObject(res);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                JSONObject data = jsonObject.getJSONObject("data");
+                return data.getString("wxUrl");
+            }
+            return null;
+        } catch (Exception e) {
+            log.error("getAllLongArticleSystemPlan error", e);
+        }
+        return null;
+    }
 }

+ 34 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/MatchServiceImpl.java

@@ -0,0 +1,34 @@
+package com.tzld.piaoquan.longarticle.service.remote.impl;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
+import com.tzld.piaoquan.longarticle.utils.HttpClientUtil;
+import com.tzld.piaoquan.longarticle.utils.HttpPoolClientUtil;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+@Slf4j
+@Service
+public class MatchServiceImpl implements MatchService {
+
+    private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(3000, 6000, 20, 100, 3, 3000);
+
+
+    @Override
+    public boolean matchMiniprogramVideo(MiniprogramCardRequest request) {
+        String apiUrl = "http://47.99.132.47:8111/search_videos";
+        try {
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(request));
+            JSONObject jsonObject = JSON.parseObject(res);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                return true;
+            }
+        } catch (Exception e) {
+            log.error("matchMiniprogramVideo error", e);
+        }
+        return false;
+    }
+}

+ 3 - 3
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/SortServiceImpl.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/SortServiceImpl.java

@@ -1,10 +1,11 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.remote.impl;
 
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSON;
 import com.tzld.piaoquan.longarticle.model.dto.ArticleSortRequest;
 import com.tzld.piaoquan.longarticle.model.dto.ArticleSortResponse;
+import com.tzld.piaoquan.longarticle.service.remote.SortService;
 import com.tzld.piaoquan.longarticle.utils.HttpClientUtil;
 import com.tzld.piaoquan.longarticle.utils.HttpPoolClientUtil;
 import lombok.extern.slf4j.Slf4j;
@@ -15,7 +16,7 @@ import java.util.Objects;
 
 @Slf4j
 @Service
-public class SortServiceImpl {
+public class SortServiceImpl implements SortService {
 
     private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 200000, 20, 100, 3, 3000);
 
@@ -27,7 +28,6 @@ public class SortServiceImpl {
             try {
                 retryTimes--;
                 String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(request));
-
                 response = JSON.parseObject(res, ArticleSortResponse.class);
                 if (Objects.nonNull(response) && Objects.nonNull(response.getData())) {
                     response.setSuccessful(true);

+ 8 - 11
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/impl/PublishServiceImpl.java → long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoServiceImpl.java

@@ -1,11 +1,11 @@
-package com.tzld.piaoquan.longarticle.service.impl;
+package com.tzld.piaoquan.longarticle.service.remote.impl;
 
 import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
-import com.tzld.piaoquan.longarticle.service.PublishService;
+import com.tzld.piaoquan.longarticle.service.remote.VideoService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
@@ -15,8 +15,10 @@ import java.util.List;
 import java.util.Map;
 
 @Service
-public class PublishServiceImpl implements PublishService {
+public class VideoServiceImpl implements VideoService {
 
+    private static final String PUBLISH_URL = "https://vlogapi.piaoquantv.com/longvideoapi/crawler/video/send";
+    private static final String VIDEO_DETAIL_URL = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo";
 
     public VideoDetail publish(String ossPath, String uid, String title, String platform, String traceId) {
         String videoId = publishToPQ(ossPath, uid, title);
@@ -32,11 +34,7 @@ public class PublishServiceImpl implements PublishService {
         return videoDetail;
     }
 
-    private static final String PUBLISH_URL = "https://vlogapi.piaoquantv.com/longvideoapi/crawler/video/send";
-    private static final String VIDEO_DETAIL_URL = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo";
-
-    public String publishToPQ(String ossPath, String uid, String title) {
-
+    private String publishToPQ(String ossPath, String uid, String title) {
         Map<String, Object> payload = new HashMap<>();
         payload.put("deviceToken", "9ef064f2f7869b3fd67d6141f8a899175dddc91240971172f1f2a662ef891408");
         payload.put("fileExtensions", "MP4");
@@ -67,11 +65,10 @@ public class PublishServiceImpl implements PublishService {
                 .execute();
         String body = response.body();
         JSONObject jsonObject = JSONUtil.parseObj(body);
-        String videoId = jsonObject.getByPath("data.id", String.class);
-        return videoId; // 返回响应体
+        return jsonObject.getByPath("data.id", String.class); // 返回响应体
     }
 
-    public VideoDetail getPQVideoDetail(String videoId) {
+    private VideoDetail getPQVideoDetail(String videoId) {
         Map<String, Object> data = new HashMap<>();
         data.put("videoIdList", new String[]{videoId});