WalletWithdrawRecordController.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App\Http\Controllers\Admin;
  3. use App\Http\Controllers\Controller;
  4. use App\Services\Admin\WalletWithdrawRecordService;
  5. use App\Http\Requests\Admin\Wallet\WithdrawAuditRequest;
  6. use App\Models\WalletWithdrawRecord;
  7. use App\Enums\WithdrawAuditStatus;
  8. /**
  9. * @group 后台
  10. *
  11. * 钱包提现记录
  12. */
  13. class WalletWithdrawRecordController extends Controller
  14. {
  15. protected WalletWithdrawRecordService $service;
  16. public function __construct(WalletWithdrawRecordService $service)
  17. {
  18. $this->service = $service;
  19. }
  20. /**
  21. * [钱包]审核提现申请
  22. *
  23. * @description 审核用户的提现申请,可以通过或拒绝
  24. *
  25. * @urlParam id required 提现记录ID Example: 1
  26. * @bodyParam status int required 审核状态(2:通过 3:拒绝) Example: 2
  27. * @bodyParam remark string optional 审核备注 Example: 审核通过
  28. *
  29. * @response 200 {
  30. * "code": 200,
  31. * "message": "审核操作成功",
  32. * "data": null
  33. * }
  34. * @response 400 {
  35. * "code": 400,
  36. * "message": "提现申请状态异常",
  37. * "data": null
  38. * }
  39. * @response 404 {
  40. * "code": 404,
  41. * "message": "提现记录不存在",
  42. * "data": null
  43. * }
  44. */
  45. public function audit(WithdrawAuditRequest $request, int $id)
  46. {
  47. $validated = $request->validated();
  48. $this->service->audit(
  49. $id,
  50. $validated['status'],
  51. $validated['remark'] ?? null
  52. );
  53. return $this->success(null, '审核操作成功');
  54. }
  55. }