From 131a0d2dfa1061811567deed40b1036204703b8d Mon Sep 17 00:00:00 2001
From: luodangjia <luodangjia>
Date: 星期五, 29 十一月 2024 14:02:27 +0800
Subject: [PATCH] 11.29

---
 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java |   30 +++++++++++++++++-------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
index 4249bdd..291de10 100644
--- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
+++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
@@ -3,20 +3,21 @@
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.ruoyi.account.api.model.BalanceChangeRecord;
 import com.ruoyi.account.service.BalanceChangeRecordService;
+import com.ruoyi.account.service.WalletService;
 import com.ruoyi.account.vo.WalletVO;
+import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
-import com.ruoyi.common.core.web.domain.AjaxResult;
+import com.ruoyi.common.security.service.TokenService;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.system.api.model.LoginUser;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
 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 javax.annotation.Resource;
-import java.math.BigDecimal;
+import java.util.List;
 
 @Api("钱包")
 @RestController
@@ -24,27 +25,30 @@
 public class WalletController extends BaseController {
     @Resource
     private BalanceChangeRecordService balanceChangeRecordService;
+    @Resource
+    private TokenService tokenService;
+    @Resource
+    private WalletService walletService;
 
     /**
      * 钱包详情
      */
     @GetMapping("detail")
-    @ApiOperation(value = "钱包详情", notes = "钱包详情")
-    public AjaxResult detail() {
-        Long userId = SecurityUtils.getUserId();
-        // TODO 查询钱包详情
-        WalletVO walletVO = new WalletVO();
-        return AjaxResult.success(walletVO);
+    @ApiOperation(value = "钱包详情", notes = "钱包详情", tags = {"小程序-个人中心-我的钱包-钱包详情"})
+    public R<WalletVO> detail() {
+        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
+        WalletVO walletVO = walletService.getWalletByUserId(loginUserApplet.getUserid());
+        return R.ok(walletVO);
     }
 
     /**
      * 变更明细
      */
-    @ApiOperation(value = "变更明细", notes = "变更明细")
+    @ApiOperation(value = "变更明细", notes = "变更明细", tags = {"小程序-个人中心-我的钱包-变更记录"})
     @GetMapping("change")
-    public AjaxResult change() {
+    public R<List<BalanceChangeRecord>> change() {
         Long userId = SecurityUtils.getUserId();
-        return AjaxResult.success(balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>()
+        return R.ok(balanceChangeRecordService.list(new LambdaQueryWrapper<BalanceChangeRecord>()
                 .eq(BalanceChangeRecord::getAppUserId, userId)));
     }
 

--
Gitblit v1.7.1