From b7610b2738fe483e07f615ce4a36493700400953 Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Thu, 22 May 2025 15:35:02 +0800 Subject: [PATCH] =?UTF-8?q?swagger=20=E6=96=87=E4=BB=B6=E8=AA=BF=E6=95=B4?= =?UTF-8?q?=2020250522?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/RoomControlController.php | 2 +- app/Http/Requests/ReceiveRoomRegisterRequest.php | 6 +++--- app/Http/Requests/ReceiveRoomStatusDataRequest.php | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/RoomControlController.php b/app/Http/Controllers/RoomControlController.php index 32a604f..1bbacc9 100644 --- a/app/Http/Controllers/RoomControlController.php +++ b/app/Http/Controllers/RoomControlController.php @@ -128,7 +128,7 @@ class RoomControlController extends Controller * @OA\Post( * path="/api/room/heartbeat", * summary="包廂心跳封包指令", - * description="。", + * description="記錄設備連線狀況", * operationId="heartbeatRoomCommand", * tags={"Room Control"}, * security={{"Authorization":{}}}, diff --git a/app/Http/Requests/ReceiveRoomRegisterRequest.php b/app/Http/Requests/ReceiveRoomRegisterRequest.php index 74a0d5d..693d935 100644 --- a/app/Http/Requests/ReceiveRoomRegisterRequest.php +++ b/app/Http/Requests/ReceiveRoomRegisterRequest.php @@ -7,9 +7,9 @@ use Illuminate\Foundation\Http\FormRequest; /** * @OA\Schema( * schema="ReceiveRoomRegisterRequest", - * required={"branch_id", "room_name", "email" ,"password"}, - * @OA\Property(property="branch_id", type="integer", example="1"), - * @OA\Property(property="room_name", type="string", example="102"), + * required={"branch_name", "room_name", "email" ,"password"}, + * @OA\Property(property="branch_name", type="string", example="測試"), + * @OA\Property(property="room_name", type="string", example="PC101"), * @OA\Property(property="room_ip", type="string", example="192.168.1.1"), * @OA\Property(property="email", type="string", example="XX@gmail.com"), * @OA\Property(property="password", type="string", example="XXX"), diff --git a/app/Http/Requests/ReceiveRoomStatusDataRequest.php b/app/Http/Requests/ReceiveRoomStatusDataRequest.php index fd71bfa..ae90d82 100644 --- a/app/Http/Requests/ReceiveRoomStatusDataRequest.php +++ b/app/Http/Requests/ReceiveRoomStatusDataRequest.php @@ -7,7 +7,8 @@ use Illuminate\Foundation\Http\FormRequest; /** * @OA\Schema( * schema="ReceiveRoomStatusDataRequest", - * required={"hostname", "ip", "status"}, + * required={"branch_name","hostname", "ip", "status"}, + * @OA\Property(property="branch_name", type="string", example="測試"), * @OA\Property(property="hostname", type="string", example="PC101"), * @OA\Property(property="ip", type="string", example="192.168.XX.XX"), * @OA\Property(property="cpu", type="numeric", example="0.00"), @@ -25,6 +26,7 @@ class ReceiveRoomStatusDataRequest extends ApiRequest public function rules(): array { return [ + 'branch_name' =>'required|string|exists:branches,name', 'hostname' => 'required|string', 'ip' => 'required|string', 'cpu' => 'nullable|numeric',