feat: 拆分开奖与结算审核流程,新增手动结果录入、重开和派彩审批接口
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\V1\Admin\Draw;
|
||||
|
||||
use App\Models\Draw;
|
||||
use App\Lottery\ErrorCode;
|
||||
use App\Support\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Draw\DrawAdminActionService;
|
||||
|
||||
final class DrawManualCloseController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DrawAdminActionService $service,
|
||||
) {}
|
||||
|
||||
public function __invoke(Draw $draw): JsonResponse
|
||||
{
|
||||
try {
|
||||
$closed = $this->service->manualClose($draw);
|
||||
} catch (\RuntimeException) {
|
||||
return ApiResponse::error(trans('api.client_error'), ErrorCode::ClientHttpError->value, null, 409);
|
||||
}
|
||||
|
||||
return ApiResponse::success([
|
||||
'draw_no' => $closed->draw_no,
|
||||
'status' => $closed->status,
|
||||
'close_time' => $closed->close_time?->toIso8601String(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user