wangming 3 mesiacov pred
rodič
commit
198e9e6923

+ 0 - 43
yami-shop-api/src/main/java/com/yami/shop/api/controller/AAAController.java

@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
- *
- * https://www.gz-yami.com/
- *
- * 未经允许,不可做商业用途!
- *
- * 版权所有,侵权必究!
- */
-
-package com.yami.shop.api.controller;
-
-import com.yami.shop.wx.po.JsapiPo;
-import com.yami.shop.wx.service.WxProviderService;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import lombok.AllArgsConstructor;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-
-@RestController
-@RequestMapping("/wx")
-@Api(tags = "地址接口")
-@AllArgsConstructor
-public class AAAController {
-
-    @Autowired
-    private WxProviderService wxProviderService;
-
-    @PostMapping("/pay")
-    @ApiOperation(value = "支付", notes = "支付")
-    public ResponseEntity<Map<String, Object>> wx(JsapiPo po) {
-        return ResponseEntity.ok(wxProviderService.subJsapi(po));
-    }
-
-}

+ 54 - 0
yami-shop-api/src/main/java/com/yami/shop/api/controller/WxPayController.java

@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
+ *
+ * https://www.gz-yami.com/
+ *
+ * 未经允许,不可做商业用途!
+ *
+ * 版权所有,侵权必究!
+ */
+
+package com.yami.shop.api.controller;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.yami.shop.wx.po.JsapiPo;
+import com.yami.shop.wx.service.WxProviderService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Map;
+
+
+@RestController
+@AllArgsConstructor
+@Api(tags = "地址接口")
+@RequestMapping("/wx")
+public class WxPayController {
+
+    @Autowired
+    private WxProviderService wxProviderService;
+
+    @PostMapping("/jsapi/pay")
+    @ApiOperation(value = "小程序支付", notes = "小程序支付")
+    public ResponseEntity<Map<String, Object>> jsapiPay(@Validated @RequestBody JsapiPo po) {
+        return ResponseEntity.ok(wxProviderService.subJsapi(po));
+    }
+
+    @GetMapping("/refundOrder")
+    @ApiOperation(value = "小程序退款", notes = "小程序退款")
+    public ResponseEntity<String> refundOrder(String orderNo) {
+        return ResponseEntity.ok(wxProviderService.refundOrder(orderNo));
+    }
+
+    @GetMapping("/getPayResultByOrderNo")
+    @ApiOperation(value = "查询微信支付订单", notes = "查询微信支付订单")
+    public ResponseEntity<Map<String, Object>> getPayResultByOrderNo(String orderNo) {
+        return ResponseEntity.ok(wxProviderService.getPayResultByOrderNo(orderNo));
+    }
+
+}

+ 0 - 4
yami-shop-wx/src/main/java/com/yami/shop/wx/po/JsapiPo.java

@@ -26,10 +26,6 @@ public class JsapiPo {
     @NotNull(message = "openId不能为空...")
     private String openId;
 
-    @ApiModelProperty(value = "goodsId")
-    @NotNull(message = "goodsId不能为空...")
-    private String goodsId;
-
     @ApiModelProperty(value = "outTradeNo")
     @NotNull(message = "outTradeNo不能为空...")
     private String outTradeNo;