|
|
@@ -1,28 +1,47 @@
|
|
|
package com.zhongshu.payment.server.core.controller.test;
|
|
|
|
|
|
+import com.zhongshu.card.client.model.feign.ProjectWxPayModel;
|
|
|
+import com.zhongshu.card.client.model.feign.ProjectWxPayParam;
|
|
|
+import com.zhongshu.card.client.model.payment.paySetting.WxPayConfigModel;
|
|
|
+import com.zhongshu.card.client.ret.ResultContent;
|
|
|
+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
|
|
|
@RequestMapping("test")
|
|
|
@Tag(name = "测试")
|
|
|
public class TestController {
|
|
|
|
|
|
-// @Resource
|
|
|
-// ProjectPaySettingFeignService projectPaySettingService;
|
|
|
-//
|
|
|
-// @Operation(summary = "测试接口", description = "测试接口")
|
|
|
-// @RequestMapping(value = "text", method = {RequestMethod.GET})
|
|
|
-// public ResultContent text() {
|
|
|
-// ProjectWxPayParam param = new ProjectWxPayParam();
|
|
|
-// param.setAppId(WxV3PayConfig.APP_ID);
|
|
|
-// ResultContent<WxPayConfigModel> resultContent = projectPaySettingService.getProjectWxPayConfig(param);
|
|
|
-// if (resultContent.isSuccess()){
|
|
|
-// Log.info(resultContent.getContent());
|
|
|
-// }
|
|
|
-// return ResultContent.buildSuccess();
|
|
|
-// }
|
|
|
+ private static final Logger log = LoggerFactory.getLogger(TestController.class);
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ProjectPaySettingFeignService projectPaySettingService;
|
|
|
+
|
|
|
+ @Operation(summary = "测试接口", description = "测试接口")
|
|
|
+ @RequestMapping(value = "text", method = {RequestMethod.GET})
|
|
|
+ public ResultContent text() {
|
|
|
+ ProjectWxPayParam param = new ProjectWxPayParam();
|
|
|
+ param.setAppId("wx92ae04fb0f325887");
|
|
|
+ ResultContent<WxPayConfigModel> content = projectPaySettingService.getProjectWxPayConfig(param);
|
|
|
+ WxPayConfigModel model = content.getContent();
|
|
|
+
|
|
|
+ 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);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|