TRX há 1 ano atrás
pai
commit
db5b81c81e

+ 9 - 3
PaymentServer/src/main/java/com/zhongshu/payment/server/core/controller/test/TestController.java

@@ -8,11 +8,14 @@ import com.zhongshu.card.client.service.ProjectPaySettingFeignService;
 import com.zhongshu.card.client.service.ProjectPaySettingService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.io.File;
 import java.util.UUID;
 
 @RestController
@@ -20,6 +23,8 @@ import java.util.UUID;
 @Tag(name = "测试")
 public class TestController {
 
+    private static final Logger log = LoggerFactory.getLogger(TestController.class);
+
     @Autowired
     ProjectPaySettingFeignService projectPaySettingService;
 
@@ -31,9 +36,10 @@ public class TestController {
         ResultContent<WxPayConfigModel> content = projectPaySettingService.getProjectWxPayConfig(param);
         WxPayConfigModel model = content.getContent();
 
-        String path = this.getClass().getClassLoader().getResource("").getPath() + "apiclientkey/apiclient_key_1680033836.pem";
-
-
+        String path = Thread.currentThread().getContextClassLoader().getResource("").getPath() + "apiclientkey/apiclient_key_1680033836.pem";
+        log.info("path: {}", path);
+        File file = new File(path);
+        log.info("file: {}", file.getAbsolutePath());
         return ResultContent.buildSuccess(model);
     }