|
|
@@ -43,48 +43,4 @@ public class WalletController {
|
|
|
@Autowired
|
|
|
AuthHelper authHelper;
|
|
|
|
|
|
- @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "初始当前用户钱包")
|
|
|
- @RequestMapping(value = "initUserWallet", method = {RequestMethod.GET})
|
|
|
- public ResultContent<Wallet> initUserWallet() {
|
|
|
- String userId = authHelper.getCurrentUser().getUserId();
|
|
|
- return walletService.initUserWallet(userId);
|
|
|
- }
|
|
|
-
|
|
|
- @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "得到当前用户钱包")
|
|
|
- @RequestMapping(value = "getUserWallet", method = {RequestMethod.GET})
|
|
|
- public ResultContent<WalletModel> getUserWallet() {
|
|
|
- String userId = authHelper.getCurrentUser().getUserId();
|
|
|
- return walletService.getUserWallet(userId);
|
|
|
- }
|
|
|
-
|
|
|
- @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "当前用户充值")
|
|
|
- @RequestMapping(value = "rechargeCurrent", method = {RequestMethod.POST})
|
|
|
- public ResultContent rechargeCurrent(@RequestBody WalletRechargeParam param) {
|
|
|
- String userId = authHelper.getCurrentUser().getUserId();
|
|
|
- param.setUserId(userId);
|
|
|
- return walletService.addWalletRecharge(param);
|
|
|
- }
|
|
|
-
|
|
|
- @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "得到用户的充值列表", description = "得到用户的充值列表: 如果userId为空,则查询当前用户的")
|
|
|
- @RequestMapping(value = {"page"}, method = {RequestMethod.POST})
|
|
|
- public ResultContent<Page<WalletRechargeModel>> page(
|
|
|
- @Parameter(hidden = true) @PageableDefault(page = 0, size = 10) Pageable pageable,
|
|
|
- @Parameter(required = false) WalletRechargeSearch param) {
|
|
|
- if (StringUtils.isEmpty(param.getUserId())) {
|
|
|
- param.setUserId(authHelper.getCurrentUser().getUserId());
|
|
|
- }
|
|
|
- return walletService.page(param, pageable);
|
|
|
- }
|
|
|
-
|
|
|
- @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
- @Operation(summary = "得到充值详情")
|
|
|
- @RequestMapping(value = "getUserWalletRecharge", method = {RequestMethod.POST})
|
|
|
- public ResultContent<WalletRechargeModel> getUserWalletRecharge(@RequestBody IDParam param) {
|
|
|
- return walletService.getUserWalletRecharge(param.getId());
|
|
|
- }
|
|
|
-
|
|
|
}
|