KTV/app/Http/Requests/ReceiveRoomStatusDataRequest.php

38 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* @OA\Schema(
2025-05-22 12:21:31 +08:00
* schema="ReceiveRoomStatusDataRequest",
2025-05-22 15:35:02 +08:00
* 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"),
* @OA\Property(property="memory", type="numeric", example="25603"),
* @OA\Property(property="disk", type="numeric", example="158266.49"),
* )
*/
2025-05-22 12:21:31 +08:00
class ReceiveRoomStatusDataRequest 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 [
2025-05-22 15:35:02 +08:00
'branch_name' =>'required|string|exists:branches,name',
'hostname' => 'required|string',
'ip' => 'required|string',
'cpu' => 'nullable|numeric',
'memory' => 'nullable|numeric',
'disk' => 'nullable|numeric',
];
}
}