lyq 1 年之前
父節點
當前提交
5a506dd670
共有 2 個文件被更改,包括 4 次插入5 次删除
  1. 1 0
      pom.xml
  2. 3 5
      src/main/java/com/sooka/sponest/event/utils/RemoteApiUtil.java

+ 1 - 0
pom.xml

@@ -102,6 +102,7 @@
             <groupId>org.springframework.cloud</groupId>
             <artifactId>spring-cloud-starter-stream-rabbit</artifactId>
         </dependency>
+
         <dependency>
             <groupId>com.dahuatech.icc</groupId>
             <artifactId>java-sdk-oauth</artifactId>

+ 3 - 5
src/main/java/com/sooka/sponest/event/utils/RemoteApiUtil.java

@@ -35,7 +35,7 @@ import java.util.concurrent.ExecutionException;
 @Component
 public class RemoteApiUtil {
 
-    private final Logger logger = LoggerFactory.getLogger(this.getClass());
+    private static final Logger logger = LoggerFactory.getLogger(RemoteApiUtil.class);
 
     private static RemoteApiUtil instance;
 
@@ -237,15 +237,13 @@ public class RemoteApiUtil {
         }
     }
 
-
     public static String encodeUrl(String input) {
         try {
             // 使用 URLEncoder 类的 encode 方法对输入字符串进行编码
             return URLEncoder.encode(input, "UTF-8");
         } catch (Exception e) {
-            e.printStackTrace();
-            return null;
+            logger.error(e.getMessage());
         }
+        return null;
     }
-
 }