Explorar o código

充值退款接口修改

zuypeng hai 1 ano
pai
achega
ecff0ecedb

+ 27 - 2
car-wash-miniapp/src/main/java/com/kym/miniapp/controller/AccountController.java

@@ -1,5 +1,6 @@
 package com.kym.miniapp.controller;
 
+import cn.dev33.satoken.stp.StpUtil;
 import com.kym.common.R;
 import com.kym.entity.admin.queryParams.CommonQueryParam;
 import com.kym.service.miniapp.AccountService;
@@ -31,6 +32,29 @@ public class AccountController {
         this.refundLogService = refundLogService;
     }
 
+    /**
+     * 钱包总览
+     *
+     * @return
+     */
+    @GetMapping("/balance")
+    public R<?> balance() {
+        return R.success(accountService.getAccountByUserId(StpUtil.getLoginIdAsLong()));
+    }
+
+
+    /**
+     * 钱包明细列表
+     *
+     * @param type
+     * @return
+     */
+    @GetMapping("/walletDetailList")
+    public R<?> walletDetailList(@RequestParam(name = "type", defaultValue = "0", required = false) int type) {
+        return R.success(walletDetailService.listWalletDetail(type));
+    }
+
+
     /**
      * 钱包明细
      *
@@ -38,8 +62,9 @@ public class AccountController {
      * @return
      */
     @GetMapping("/walletDetail")
-    public R<?> walletDetail(@RequestParam(name = "type", defaultValue = "0", required = false) int type) {
-        return R.success(walletDetailService.listWalletDetail(type));
+    public R<?> walletDetailList(@RequestParam(name = "type", defaultValue = "0", required = false) int type,
+                                 @RequestParam(name = "orderNo", required = false) String orderNo) {
+        return R.success(walletDetailService.getWalletDetailByOrderNo(orderNo, type));
     }
 
     /**

+ 56 - 0
car-wash-miniapp/src/main/java/com/kym/miniapp/controller/FaqController.java

@@ -0,0 +1,56 @@
+package com.kym.miniapp.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.kym.common.R;
+import com.kym.common.annotation.SysLog;
+import com.kym.common.controller.IController;
+import com.kym.entity.admin.Faq;
+import com.kym.entity.admin.queryParams.FaqQueryParam;
+import com.kym.service.admin.FaqService;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.web.bind.annotation.GetMapping;
+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;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 常见问题 前端控制器
+ * </p>
+ *
+ * @since 2024-11-12
+ */
+@RestController
+@RequestMapping("/faq")
+public class FaqController extends IController {
+
+    @Resource
+    private FaqService faqService;
+
+    /**
+     * 纠错反馈查询接口
+     *
+     * @return Res
+     */
+    @PostMapping("list")
+    @SysLog(value = "纠错反馈列表查询接口")
+    public R<?> list(@RequestBody FaqQueryParam query) {
+        return resp(() -> faqService.list(query));
+    }
+
+
+    /**
+     * 纠错反馈查询详情接口
+     *
+     * @return Res
+     */
+    @GetMapping("detail/{id}")
+    @SysLog(value = "纠错反馈详情查询接口")
+    public R<?> detail(@PathVariable long id) {
+        return resp(() -> faqService.detail(id));
+    }
+
+}

+ 71 - 0
car-wash-miniapp/src/main/java/com/kym/miniapp/controller/FeedbackController.java

@@ -0,0 +1,71 @@
+package com.kym.miniapp.controller;
+
+import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.kym.common.R;
+import com.kym.common.annotation.SysLog;
+import com.kym.common.controller.IController;
+import com.kym.entity.admin.Feedback;
+import com.kym.entity.admin.queryParams.FeedbackQueryParam;
+import com.kym.service.admin.FeedbackService;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.web.bind.annotation.GetMapping;
+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;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * 纠错反馈接口
+ *
+ * @date 2024-09-22T20:40:35.300431885
+ */
+@RestController
+@RequestMapping("feedback")
+public class FeedbackController extends IController {
+
+    @Resource
+    private FeedbackService feedbackService;
+
+
+    /**
+     * 纠错反馈新增接口
+     *
+     * @param feedback 新增纠错反馈
+     * @return Res
+     */
+    @PostMapping("add")
+    @SysLog(value = "纠错反馈新增接口")
+    public R<?> add(@Valid @RequestBody Feedback feedback) {
+//other params checked
+        return resp(() -> feedbackService.add(feedback));
+    }
+
+    /**
+     * 纠错反馈查询接口
+     *
+     * @return Res
+     */
+    @PostMapping("list")
+    @SysLog(value = "纠错反馈列表查询接口")
+    public R<?> list(@RequestBody FeedbackQueryParam query) {
+        return resp(() -> feedbackService.list(query));
+    }
+
+
+    /**
+     * 纠错反馈查询详情接口
+     *
+     * @return Res
+     */
+    @GetMapping("detail/{id}")
+    @SysLog(value = "纠错反馈详情查询接口")
+    public R<?> detail(@PathVariable long id) {
+        return resp(() -> feedbackService.detail(id));
+    }
+
+
+
+}

+ 6 - 3
car-wash-miniapp/src/main/java/com/kym/miniapp/controller/PaymentController.java

@@ -8,9 +8,12 @@ import jakarta.servlet.http.HttpServletRequest;
 import lombok.SneakyThrows;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 
 
@@ -35,9 +38,9 @@ public class PaymentController {
      * @return
      */
     @ApiLog("微信支付")
-    @PostMapping("/wxPay")
+    @GetMapping("/wxPay")
     @ResponseBody
-    R<?> prepay(@RequestBody Long rechargeConfigId) {
+    R<?> prepay(@RequestParam Long rechargeConfigId) {
         return R.success(wxPayService.wxPay(rechargeConfigId));
     }
 
@@ -52,7 +55,7 @@ public class PaymentController {
     @ApiLog("用户申请退款")
     @PostMapping("/wxApplyRefund")
     @ResponseBody
-    R<?> wxAppRefund(@RequestBody String reason) {
+    R<?> wxAppRefund(@RequestParam String reason) {
         wxPayService.applyWxRefund(reason);
         return R.success();
     }

+ 1 - 0
car-wash-service/src/main/java/com/kym/service/admin/impl/FeedbackServiceImpl.java

@@ -25,6 +25,7 @@ public class FeedbackServiceImpl extends MyBaseServiceImpl<FeedbackMapper, Feedb
 
     @Override
     public int add(Feedback feedback) {
+        StpUtil.checkLogin();
         save(feedback);
         return 0;
     }