|
|
@@ -81,6 +81,27 @@ public class WalletController {
|
|
|
return Response.ok(Map.of("transactionId", tx.getId().toString(), "status", tx.getStatus()));
|
|
|
}
|
|
|
|
|
|
+ @Operation(summary = "获取待审核提现列表(管理员)")
|
|
|
+ @PreAuthorize("hasRole('ROLE_admin')")
|
|
|
+ @GetMapping("withdraw/pending")
|
|
|
+ public Response<List<WalletTransactionVo>> listPendingWithdrawals(
|
|
|
+ @RequestParam(defaultValue = "1") int pageNum,
|
|
|
+ @RequestParam(defaultValue = "20") int pageSize) {
|
|
|
+ List<WalletTransaction> list = walletService.listPendingWithdrawals(pageNum, pageSize);
|
|
|
+ return Response.ok(WalletTransactionVo.from(list));
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "审核提现(管理员)")
|
|
|
+ @PreAuthorize("hasRole('ROLE_admin')")
|
|
|
+ @PutMapping("withdraw/{id}/review")
|
|
|
+ public Response<Void> reviewWithdraw(@PathVariable Long id, @RequestBody Map<String, Object> body) {
|
|
|
+ Boolean approved = (Boolean) body.get("approved");
|
|
|
+ String rejectReason = (String) body.get("rejectReason");
|
|
|
+ if (approved == null) return Response.error("请指定审核结果");
|
|
|
+ walletService.reviewWithdraw(id, approved, rejectReason);
|
|
|
+ return Response.ok();
|
|
|
+ }
|
|
|
+
|
|
|
@Operation(summary = "资金明细")
|
|
|
@PreAuthorize("hasAnyRole('ROLE_user', 'ROLE_expert', 'ROLE_admin')")
|
|
|
@GetMapping("transactions")
|