問題修正

This commit is contained in:
allen.yan 2025-06-04 15:37:16 +08:00
parent e8bdbaf7eb
commit 1a9aeb7fb3
2 changed files with 12 additions and 6 deletions

View File

@ -36,12 +36,7 @@ class BranchControlController extends Controller
* @OA\Property( * @OA\Property(
* property="rooms", * property="rooms",
* type="object", * type="object",
* additionalProperties=@OA\Schema( * additionalProperties={"$ref": "#/components/schemas/RoomInfo"}
* @OA\Property(property="is_online", type="boolean", example=true),
* @OA\Property(property="status", ref="#/components/schemas/RoomStatus"),
* @OA\Property(property="started_at", type="string", format="date-time", example="2025-06-04 10:00:00Z"),
* @OA\Property(property="ended_at", type="string", format="date-time", example="2025-06-04 12:00:00Z")
* )
* ) * )
* )) * ))
* ) * )
@ -62,6 +57,7 @@ class BranchControlController extends Controller
* ), * ),
* ) * )
*/ */
public function Branches(Request $request): JsonResponse public function Branches(Request $request): JsonResponse
{ {
$branches = Branch::with('rooms')->get()->map(function ($branch) { $branches = Branch::with('rooms')->get()->map(function ($branch) {

View File

@ -21,6 +21,16 @@ use App\Traits\LogsModelActivity;
* @OA\Property(property="ended_at", type="string", format="date-time", example=null), * @OA\Property(property="ended_at", type="string", format="date-time", example=null),
* ) * )
*/ */
/**
* @OA\Schema(
* schema="RoomInfo",
* type="object",
* @OA\Property(property="is_online", type="boolean", example=true),
* @OA\Property(property="status", ref="#/components/schemas/RoomStatus"),
* @OA\Property(property="started_at", type="string", format="date-time", example="2025-06-04T10:00:00Z"),
* @OA\Property(property="ended_at", type="string", format="date-time", example="2025-06-04T12:00:00Z")
* )
*/
class Room extends Model class Room extends Model
{ {
/** @use HasFactory<\Database\Factories\ArtistFactory> */ /** @use HasFactory<\Database\Factories\ArtistFactory> */