改进 userproxy bizquery 方法
authorTang Cheng <cheng.tang@supwisdom.com>
Fri, 8 Nov 2019 01:45:34 +0000 (09:45 +0800)
committerTang Cheng <cheng.tang@supwisdom.com>
Mon, 16 Dec 2019 02:45:18 +0000 (10:45 +0800)
payapi-sdk/src/main/java/com/supwisdom/dlpay/paysdk/proxy/UserProxy.java
payapi/src/main/kotlin/com/supwisdom/dlpay/api/controller/user_api_controller.kt

index f288a14..7a17aec 100644 (file)
@@ -2,9 +2,7 @@ package com.supwisdom.dlpay.paysdk.proxy;
 
 import com.supwisdom.dlpay.api.bean.*;
 import org.springframework.cloud.openfeign.FeignClient;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.*;
 
 @FeignClient(value = "userProxy", url = "${payapi.url}")
 public interface UserProxy {
@@ -38,6 +36,6 @@ public interface UserProxy {
   @PostMapping("/api/user/biz_refund")
   CardBizResponse bizRefund(String refno);
 
-  @GetMapping("/api/user/biz_query")
-  CardBizResponse bizQuery(String refno);
+  @RequestMapping(value = "/api/user/biz_query", method = RequestMethod.GET)
+  CardBizResponse bizQuery(@RequestParam("refno") String refno);
 }
index 05b9737..a964b02 100644 (file)
@@ -335,7 +335,7 @@ class UserAPIController {
     }
 
     @PostMapping("/biz_refund")
-    fun userBizRefund(@RequestBody refno: String): ResponseEntity<Any> {
+    fun userBizRefund(refno: String): ResponseEntity<Any> {
         val result = CardBizResponse()
         val transaction = transactionService.success(refno)
         result.apply {
@@ -351,7 +351,7 @@ class UserAPIController {
     }
 
     @GetMapping("/biz_query")
-    fun userBizQuery(@RequestBody refno: String): ResponseEntity<Any> {
+    fun userBizQuery(refno: String): ResponseEntity<Any> {
         val transaction = transactionService.findTransactionByRefno(refno)
                 ?: throw TransactionCheckException(TradeErrorCode.TRANSACTION_NOT_EXISTS
                         , "交易不存在")