瀏覽代碼

修改异常

xueyiming 5 月之前
父節點
當前提交
8346484dad

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

@@ -33,7 +33,7 @@ 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");
         add("20250208111811026884434");
     }};
@@ -89,8 +89,9 @@ public class CardServiceImpl implements CardService {
             }
             return sb.toString();
         } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException(e);
+            log.error("CardServiceImpl md5 error", e);
         }
+        return null;
     }
 
     public PublishMiniprogram generateSingleCard(Integer index, Integer miniId, VideoDetail videoDetail,

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

@@ -999,7 +999,7 @@ public class CoreServiceImpl implements CoreService {
                                 }
                             }
                         } catch (InterruptedException e) {
-                            throw new RuntimeException(e);
+                            log.error("匹配小程序线程异常", e);
                         }
                     }
                     log.info("启动匹配小程序线程结束");
@@ -1034,7 +1034,7 @@ public class CoreServiceImpl implements CoreService {
                     try {
                         matchQueue.put(matchContent);
                     } catch (InterruptedException e) {
-                        throw new RuntimeException(e);
+                        log.error("matchQueue put error", e);
                     }
                 }
             }

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

@@ -263,7 +263,7 @@ public class MatchVideoServiceImpl {
                             }
                             processCrawlerMatchContent(matchVideo);
                         } catch (InterruptedException e) {
-                            throw new RuntimeException(e);
+                            log.error("匹配小程序线程异常", e);
                         }
                     }
                     log.info("启动匹配小程序线程结束");
@@ -388,7 +388,7 @@ public class MatchVideoServiceImpl {
                             }
                             processUploadCrawlerVideo(matchVideo);
                         } catch (InterruptedException e) {
-                            throw new RuntimeException(e);
+                            log.error("上传小程序视频线程异常", e);
                         }
                     }
                     log.info("启动匹配小程序线程结束");

+ 5 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/other/HkspSearch.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.longarticle.common.constants.CrawlerConstant;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.CrawlerVideo;
+import lombok.extern.slf4j.Slf4j;
 
 
 import java.io.IOException;
@@ -14,6 +15,7 @@ import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.*;
 
+@Slf4j
 public class HkspSearch {
 
 
@@ -47,7 +49,7 @@ public class HkspSearch {
         );
         List<String> sensitiveWords = new ArrayList<>();
         List<JSONObject> list = hkspSearch("法律纠纷,教育投资,家庭责任", sensitiveWords, "");
-        for (JSONObject jsonObject : list){
+        for (JSONObject jsonObject : list) {
             CrawlerVideo crawlerVideo = baiduVideoProduce(jsonObject);
             System.out.println(jsonObject);
             System.out.println(crawlerVideo);
@@ -127,8 +129,9 @@ public class HkspSearch {
             }
             return sb.toString();
         } catch (NoSuchAlgorithmException e) {
-            throw new RuntimeException(e);
+            log.error("HkspSearch md5 error", e);
         }
+        return "";
     }
 
     private static boolean sensitiveFlag(List<String> sensitiveWords, String title) {