skyline 2 лет назад
Родитель
Сommit
9dfe03111d

+ 6 - 0
entity/src/main/java/com/kym/entity/admin/queryParams/CommonQueryParam.java

@@ -2,6 +2,7 @@ package com.kym.entity.admin.queryParams;
 
 import com.kym.entity.common.PageParams;
 import lombok.Data;
+import lombok.experimental.Accessors;
 
 /**
  * @author skyline
@@ -9,11 +10,16 @@ import lombok.Data;
  * @date 2023-08-22 18:56
  */
 @Data
+@Accessors(chain = true)
 public class CommonQueryParam extends PageParams {
     /**
      * id
      */
     private Long id;
+    /**
+     * 用户id
+     */
+    private Long userId;
     /**
      * 手机号
      */

+ 12 - 5
miniapp/src/main/java/com/kym/miniapp/controller/AccountController.java

@@ -1,11 +1,10 @@
 package com.kym.miniapp.controller;
 
 import com.kym.common.R;
+import com.kym.entity.admin.queryParams.CommonQueryParam;
+import com.kym.service.miniapp.RefundLogService;
 import com.kym.service.miniapp.WalletDetailService;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 /**
  * <p>
@@ -21,8 +20,11 @@ public class AccountController {
 
     private final WalletDetailService walletDetailService;
 
-    public AccountController(WalletDetailService walletDetailService) {
+    private final RefundLogService refundLogService;
+
+    public AccountController(WalletDetailService walletDetailService, RefundLogService refundLogService) {
         this.walletDetailService = walletDetailService;
+        this.refundLogService = refundLogService;
     }
 
     /**
@@ -36,4 +38,9 @@ public class AccountController {
         return R.success(walletDetailService.listWalletDetail(type));
     }
 
+    @PostMapping("/listRefund")
+    public R<?> listRefund(@RequestBody CommonQueryParam params) {
+        return R.success(refundLogService.listRefundLogForApp(params));
+    }
+
 }

+ 4 - 0
service/src/main/java/com/kym/service/miniapp/RefundLogService.java

@@ -6,6 +6,8 @@ import com.kym.entity.common.PageBean;
 import com.kym.entity.miniapp.RefundLog;
 import com.kym.entity.miniapp.vo.RefundVo;
 
+import java.util.List;
+
 /**
  * <p>
  * 退款日志 服务类
@@ -16,4 +18,6 @@ import com.kym.entity.miniapp.vo.RefundVo;
  */
 public interface RefundLogService extends MPJBaseService<RefundLog> {
     PageBean<RefundVo> listRefundLog(CommonQueryParam params);
+
+    PageBean<RefundLog> listRefundLogForApp(CommonQueryParam params);
 }

+ 7 - 0
service/src/main/java/com/kym/service/miniapp/impl/RefundLogServiceImpl.java

@@ -29,4 +29,11 @@ public class RefundLogServiceImpl extends MPJBaseServiceImpl<RefundLogMapper, Re
         var list = baseMapper.listRefundLog(params);
         return new PageBean<>(list);
     }
+
+    @Override
+    public PageBean<RefundLog> listRefundLogForApp(CommonQueryParam params) {
+        PageHelper.startPage(params.getPageNum(), params.getPageSize());
+        var list = lambdaQuery().eq(RefundLog::getUserId, params.getUserId()).orderByDesc(RefundLog::getCreateTime).list();
+        return new PageBean<>(list);
+    }
 }