You've already forked FrameTour-BE
系统支付对接、避免返回过多数据
This commit is contained in:
@@ -10,6 +10,7 @@ import com.ycwl.basic.utils.ApiResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -33,12 +34,6 @@ public class AppWxPayController {
|
||||
@Autowired
|
||||
private WxPayService wxPayService;
|
||||
|
||||
@ApiOperation(value = "微信预支付", notes = "微信预支付")
|
||||
@PostMapping("/createOrder")
|
||||
public ApiResponse<WxPayRespVO> createOrder(@RequestBody WXPayOrderReqVO req) throws Exception {
|
||||
return ApiResponse.success(wxPayService.createOrder(req));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "微信支付回调", notes = "微信支付回调")
|
||||
@PostMapping("/payNotify")
|
||||
@IgnoreToken
|
||||
@@ -46,29 +41,19 @@ public class AppWxPayController {
|
||||
wxPayService.payNotify(request);
|
||||
return ApiResponse.success(BizCodeEnum.REQUEST_OK);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "微信退款", notes = "微信退款")
|
||||
@PostMapping("/refundOrder")
|
||||
public ApiResponse<?> refundOrder(@RequestBody String orderId) throws Exception {
|
||||
return ApiResponse.buildResult(wxPayService.refundOrder(orderId) ?
|
||||
BizCodeEnum.SUCCESS :
|
||||
BizCodeEnum.ADVANCE_PAYMENT_REFUND_FAILED);
|
||||
@PostMapping("/{scenicId}/payNotify")
|
||||
@IgnoreToken
|
||||
public ApiResponse<?> payNotifyByScenicId(@PathVariable Long scenicId, HttpServletRequest request) {
|
||||
wxPayService.payNotify(scenicId, request);
|
||||
return ApiResponse.success(BizCodeEnum.REQUEST_OK);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "微信支付退款回调", notes = "微信支付退款回调")
|
||||
@PostMapping("/refundNotify")
|
||||
@PostMapping("/{scenicId}/refundNotify")
|
||||
@IgnoreToken
|
||||
public ApiResponse<?> refundNotify(@RequestBody String refundResult) throws GeneralSecurityException, IOException {
|
||||
return ApiResponse.buildResult(wxPayService.refundNotify(refundResult) ?
|
||||
public ApiResponse<?> refundNotify(@PathVariable Long scenicId, HttpServletRequest request) throws GeneralSecurityException, IOException {
|
||||
return ApiResponse.buildResult(wxPayService.refundNotify(scenicId, request) ?
|
||||
BizCodeEnum.SUCCESS :
|
||||
BizCodeEnum.ADVANCE_PAYMENT_CALLBACK_REFUND_FAILED);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "微信关闭订单", notes = "微信关闭订单")
|
||||
@PostMapping("/closeOrder")
|
||||
@IgnoreToken
|
||||
public ApiResponse<?> closeOrder(@RequestBody String orderId) {
|
||||
wxPayService.closeOrder(orderId);
|
||||
return ApiResponse.buildResult(BizCodeEnum.REQUEST_OK);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user