調整 正規化 20250701

ReceiveRoomRegisterRequest
 移除 branch_name
 改為nullable ,room_name,room_ip
This commit is contained in:
allen.yan 2025-07-01 21:14:45 +08:00
parent 532168f4d1
commit 0d5f78236b

View File

@ -7,10 +7,7 @@ use Illuminate\Foundation\Http\FormRequest;
/** /**
* @OA\Schema( * @OA\Schema(
* schema="ReceiveRoomRegisterRequest", * schema="ReceiveRoomRegisterRequest",
* required={"branch_name", "room_name", "email" ,"password"}, * required={ "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="email", type="string", example="XX@gmail.com"),
* @OA\Property(property="password", type="string", example="XXX"), * @OA\Property(property="password", type="string", example="XXX"),
* ) * )
@ -25,9 +22,8 @@ class ReceiveRoomRegisterRequest extends ApiRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'branch_name' =>'required|string|exists:branches,name', 'room_name' => 'nullable|string',
'room_name' => 'required|string', 'room_ip' => 'nullable|string',
'room_ip' => 'required|string',
'email' => 'required|email', 'email' => 'required|email',
'password' => 'required', 'password' => 'required',
]; ];