Prechádzať zdrojové kódy

Merge branch 'master' into dev-xym-settings

xueyiming 6 mesiacov pred
rodič
commit
9e51cbf5f9

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

@@ -255,13 +255,12 @@ public class ContentServiceImpl implements ContentService {
             String platform = crawlerVideo.getPlatform();
             String userId = crawlerVideo.getUserId();
             String traceId = matchVideo.getTraceId();
-            String kimiTitle;
             LongArticlesText kimiText = kimiService.getKimiText(crawlerVideo.getContentId());
-            if (kimiText != null && StringUtils.isNotEmpty(kimiText.getKimiTitle())) {
-                kimiTitle = kimiText.getKimiTitle();
-            } else {
-                kimiTitle = crawlerVideo.getVideoTitle();
+            if (kimiText == null || StringUtils.isEmpty(kimiText.getKimiTitle())) {
+                log.error("crawlerVideo kimiText is null contentId={}", crawlerVideo.getContentId());
+                continue;
             }
+            String kimiTitle = kimiText.getKimiTitle();
             VideoDetail videoDetail = videoService.publish(videoOssPath, userId, kimiTitle);
             if (videoDetail == null) {
                 continue;

+ 18 - 14
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java

@@ -168,21 +168,25 @@ public class AigcServiceImpl implements AigcService {
         if (StringUtils.isEmpty(coverUrl) || StringUtils.isEmpty(publishContentId)) {
             return null;
         }
-        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");
+        int retey = 0;
+        while (retey < 3) {
+            String apiUrl = "http://aigc-api.cybertogether.net/aigc//publish/LongArticleSystem/uploadMiniprogramCover";
+            try {
+                JSONObject param = new JSONObject();
+                param.put("coverUrl", coverUrl);
+                param.put("publishContentId", publishContentId);
+                log.info("pushCover param={}", param);
+                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");
+                }
+            } catch (Exception e) {
+                log.error("pushCover error", e);
             }
-            return null;
-        } catch (Exception e) {
-            log.error("pushCover error", e);
+            retey++;
         }
         return null;
     }