fix(service): 修复查询用户主题时调用错误服务

将 KeyboardThemePurchaseService 改为 userThemesService,并调整查询条件从支付状态改为删除标记,确保获取正确的用户主题列表。
This commit is contained in:
2025-12-22 18:31:04 +08:00
parent ecce22384b
commit 45d6058b90
10 changed files with 129 additions and 16 deletions

View File

@@ -99,4 +99,12 @@ public class ThemesController {
return ResultUtils.success(result);
}
@PostMapping("/restore")
@Operation(summary = "恢复已删除的主题", description = "将用户已删除的主题重新展示")
public BaseResponse<Void> restoreTheme(@RequestParam Long themeId) {
Long userId = StpUtil.getLoginIdAsLong();
themePurchaseService.restoreDeletedTheme(userId, themeId);
return ResultUtils.success(null);
}
}

View File

@@ -1,16 +1,20 @@
package com.yolo.keyborad.controller;
import cn.dev33.satoken.stp.StpUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yolo.keyborad.common.BaseResponse;
import com.yolo.keyborad.common.ResultUtils;
import com.yolo.keyborad.model.vo.wallet.KeyboardUserWalletRespVO;
import com.yolo.keyborad.model.vo.wallet.WalletTransactionRespVO;
import com.yolo.keyborad.service.KeyboardUserWalletService;
import com.yolo.keyborad.service.KeyboardWalletTransactionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
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;
/*
@@ -26,6 +30,9 @@ public class WalletController {
@Resource
private KeyboardUserWalletService walletService;
@Resource
private KeyboardWalletTransactionService transactionService;
@GetMapping("/balance")
@Operation(summary = "查询钱包余额", description = "查询当前登录用户的钱包余额")
public BaseResponse<KeyboardUserWalletRespVO> getBalance() {
@@ -33,4 +40,14 @@ public class WalletController {
KeyboardUserWalletRespVO balance = walletService.getWalletBalance(userId);
return ResultUtils.success(balance);
}
@GetMapping("/transactions")
@Operation(summary = "分页查询钱包交易记录", description = "分页查询当前用户的钱包交易记录")
public BaseResponse<IPage<WalletTransactionRespVO>> getTransactions(
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize) {
Long userId = StpUtil.getLoginIdAsLong();
IPage<WalletTransactionRespVO> transactions = transactionService.getUserTransactions(userId, pageNum, pageSize);
return ResultUtils.success(transactions);
}
}