1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Http\Controllers\Controller;
- use App\Services\Admin\WalletWithdrawRecordService;
- use App\Http\Requests\Admin\Wallet\WithdrawAuditRequest;
- use App\Models\WalletWithdrawRecord;
- use App\Enums\WithdrawAuditStatus;
- /**
- * @group 后台
- *
- * 钱包提现记录
- */
- class WalletWithdrawRecordController extends Controller
- {
- protected WalletWithdrawRecordService $service;
- public function __construct(WalletWithdrawRecordService $service)
- {
- $this->service = $service;
- }
- /**
- * [钱包]审核提现申请
- *
- * @description 审核用户的提现申请,可以通过或拒绝
- *
- * @urlParam id required 提现记录ID Example: 1
- * @bodyParam status int required 审核状态(2:通过 3:拒绝) Example: 2
- * @bodyParam remark string optional 审核备注 Example: 审核通过
- *
- * @response 200 {
- * "code": 200,
- * "message": "审核操作成功",
- * "data": null
- * }
- * @response 400 {
- * "code": 400,
- * "message": "提现申请状态异常",
- * "data": null
- * }
- * @response 404 {
- * "code": 404,
- * "message": "提现记录不存在",
- * "data": null
- * }
- */
- public function audit(WithdrawAuditRequest $request, int $id)
- {
- $validated = $request->validated();
- $this->service->audit(
- $id,
- $validated['status'],
- $validated['remark'] ?? null
- );
- return $this->success(null, '审核操作成功');
- }
- }
|