單機版 v.0.0.4 20250617

BUG
This commit is contained in:
allen.yan 2025-06-17 13:39:17 +08:00
parent 2785991439
commit 9e054f63ee
3 changed files with 2 additions and 72 deletions

View File

@ -2,6 +2,8 @@
namespace App\Http\Controllers;
use App\Http\Requests\ReceiveRoomRegisterRequest;
use App\Http\Requests\ReceiveRoomStatusDataRequest;
use App\Http\Requests\SendRoomSwitchCommandRequest;
use App\Http\Requests\ReceiveSwitchRequest;
use App\Services\TcpSocketClient;

View File

@ -1,35 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* @OA\Schema(
* schema="ReceiveRoomRegisterRequest",
* required={"branch", "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"),
* )
*/
class ReceiveRoomRegisterRequest 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',
'room_name' => 'required|string',
'room_ip' => 'required|string',
'email' => 'required|email',
'password' => 'required',
];
}
}

View File

@ -1,37 +0,0 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
/**
* @OA\Schema(
* schema="ReceiveRoomStatusDataRequest",
* required={"branch_name","hostname", "ip"},
* @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',
];
}
}