From 6c002cf8312b36260d51a3600231ec49fdd272c6 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Wed, 4 Jun 2025 15:40:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=8F=E9=A1=8C=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/BranchControlController.php | 12 ++++++++++-- app/Models/Room.php | 11 +---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/BranchControlController.php b/app/Http/Controllers/BranchControlController.php index 59ced23..96a8469 100644 --- a/app/Http/Controllers/BranchControlController.php +++ b/app/Http/Controllers/BranchControlController.php @@ -6,7 +6,6 @@ use Illuminate\Http\Request; use Illuminate\Http\JsonResponse; use Illuminate\Support\Facades\Auth; use App\Models\Branch; -use App\Models\Room; use App\Enums\RoomType; use App\Enums\RoomStatus; use App\Http\Responses\ApiResponse; @@ -58,7 +57,16 @@ class BranchControlController extends Controller * ), * ) */ - + /** + * @OA\Schema( + * schema="RoomInfo", + * type="object", + * @OA\Property(property="is_online", type="boolean", example=true), + * @OA\Property(property="status", ref="#/components/schemas/RoomStatus"), + * @OA\Property(property="started_at", type="string", format="date-time", example="2025-06-04T10:00:00Z"), + * @OA\Property(property="ended_at", type="string", format="date-time", example="2025-06-04T12:00:00Z") + * ) + */ public function Branches(Request $request): JsonResponse { $branches = Branch::with('rooms')->get()->map(function ($branch) { diff --git a/app/Models/Room.php b/app/Models/Room.php index 09094ab..7a09922 100644 --- a/app/Models/Room.php +++ b/app/Models/Room.php @@ -21,16 +21,7 @@ use App\Traits\LogsModelActivity; * @OA\Property(property="ended_at", type="string", format="date-time", example=null), * ) */ -/** - * @OA\Schema( - * schema="RoomInfo", - * type="object", - * @OA\Property(property="is_online", type="boolean", example=true), - * @OA\Property(property="status", ref="#/components/schemas/RoomStatus"), - * @OA\Property(property="started_at", type="string", format="date-time", example="2025-06-04T10:00:00Z"), - * @OA\Property(property="ended_at", type="string", format="date-time", example="2025-06-04T12:00:00Z") - * ) - */ + class Room extends Model { /** @use HasFactory<\Database\Factories\ArtistFactory> */