Swagger Room加入TcpSocketClient Swagger room 加入 設備註冊,設備開關 Swagger room 有異動需要寫記錄 20250519
36 lines
1.2 KiB
PHP
36 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
/**
|
|
* @OA\Schema(
|
|
* schema="SendRoomSwitchCommandRequest",
|
|
* required={"room_id", "command"},
|
|
* @OA\Property(property="branch_id", type="integer", example="5"),
|
|
* @OA\Property(property="room_name", type="string", example="pc102"),
|
|
* @OA\Property(property="command", type="string", enum={"active", "closed", "fire", "maintenance"}, example="active"),
|
|
* @OA\Property(property="started_at", type="string", nullable=true, example="2025-05-19 09:31:00"),
|
|
* @OA\Property(property="ended_at", type="string", nullable=true, example="2025-05-19 09:31:00")
|
|
* )
|
|
*/
|
|
class SendRoomSwitchCommandRequest extends ApiRequest
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'branch_id' => 'required|integer',
|
|
'room_name' => 'required|string',
|
|
'command' => 'required|string',
|
|
'started_at' => 'nullable|date_format:Y-m-d H:i:s',
|
|
'ended_at' => 'nullable|date_format:Y-m-d H:i:s',
|
|
];
|
|
}
|
|
}
|