luodangjia
2024-11-29 131a0d2dfa1061811567deed40b1036204703b8d
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/WalletController.java
@@ -3,11 +3,13 @@
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 org.springframework.web.bind.annotation.GetMapping;
@@ -23,6 +25,10 @@
public class WalletController extends BaseController {
    @Resource
    private BalanceChangeRecordService balanceChangeRecordService;
    @Resource
    private TokenService tokenService;
    @Resource
    private WalletService walletService;
    /**
     * 钱包详情
@@ -30,9 +36,8 @@
    @GetMapping("detail")
    @ApiOperation(value = "钱包详情", notes = "钱包详情", tags = {"小程序-个人中心-我的钱包-钱包详情"})
    public R<WalletVO> detail() {
        Long userId = SecurityUtils.getUserId();
        // TODO 查询钱包详情
        WalletVO walletVO = new WalletVO();
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        WalletVO walletVO = walletService.getWalletByUserId(loginUserApplet.getUserid());
        return R.ok(walletVO);
    }