KTV/app/Http/Requests/ReceiveRoomStatusDataRequest.php

38 lines
1.2 KiB
PHP

<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* @OA\Schema(
* schema="ReceiveRoomStatusDataRequest",
* 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"),
* )
*/
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 [
'branch_name' =>'required|string|exists:branches,name',
'hostname' => 'required|string',
'ip' => 'required|string',
'cpu' => 'nullable|numeric',
'memory' => 'nullable|numeric',
'disk' => 'nullable|numeric',
];
}
}