From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:48:08 +0800 Subject: [PATCH] 修改文件上传类型限制 --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WalletApi.java | 74 +++++++++++++++++++++++++++++++++++++ 1 files changed, 74 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WalletApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WalletApi.java new file mode 100644 index 0000000..fdf1095 --- /dev/null +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WalletApi.java @@ -0,0 +1,74 @@ +package com.panzhihua.applets.api; + +import javax.annotation.Resource; + +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; + +import com.panzhihua.common.controller.BaseController; +import com.panzhihua.common.model.dtos.community.wallet.ComActWalletDetailDTO; +import com.panzhihua.common.model.dtos.community.wallet.PageComActWalletTradeDTO; +import com.panzhihua.common.model.vos.LoginUserInfoVO; +import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.wallet.ComActWalletRankingVO; +import com.panzhihua.common.model.vos.community.wallet.ComActWalletTradeVO; +import com.panzhihua.common.model.vos.community.wallet.ComActWalletVO; +import com.panzhihua.common.service.community.CommunityService; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; + +@RestController +@RequestMapping("/wallet/") +@Api(tags = {"钱包模块"}) +public class WalletApi extends BaseController { + + @Resource + private CommunityService communityService; + + @ApiOperation(value = "查询我的钱包", response = ComActWalletVO.class) + @PostMapping("/get/my") + public R getWallet() { + ComActWalletDetailDTO walletDetailDTO = new ComActWalletDetailDTO(); + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + if (loginUserInfo == null) { + return R.fail("请先登录"); + } + walletDetailDTO.setUserId(loginUserInfo.getUserId()); + Long communityId = loginUserInfo.getCommunityId(); + if (null == communityId || 0 == communityId) { + return R.fail("用户未绑定社区"); + } + walletDetailDTO.setCommunityId(communityId); + return communityService.getUserWalletDetail(walletDetailDTO); + } + + @ApiOperation(value = "查询我的收支记录", response = ComActWalletTradeVO.class) + @PostMapping("/get/trade") + public R getWalletTrade(@RequestBody PageComActWalletTradeDTO walletTradeDTO) { + LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + if (loginUserInfo == null) { + return R.fail("请先登录"); + } + walletTradeDTO.setUserId(loginUserInfo.getUserId()); + Long communityId = loginUserInfo.getCommunityId(); + if (null == communityId || 0 == communityId) { + return R.fail("用户未绑定社区"); + } + walletTradeDTO.setCommunityId(communityId); + return communityService.getUserWalletTrade(walletTradeDTO); + } + + @ApiOperation(value = "查询收益排行榜", response = ComActWalletRankingVO.class) + @PostMapping("/get/ranking") + public R getWalletRanking(@RequestBody PageComActWalletTradeDTO walletTradeDTO) { + Long communityId = this.getCommunityId(); + if (null == communityId || 0 == communityId) { + return R.fail("用户未绑定社区"); + } + walletTradeDTO.setCommunityId(communityId); + return communityService.getWalletRanking(walletTradeDTO); + } +} -- Gitblit v1.7.1