From 15ece8e7b584a8a495fe0880db4a48937ca5569c Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Mon, 19 May 2025 17:21:39 +0800 Subject: [PATCH] =?UTF-8?q?Swagger=20=E5=9C=A8=E6=AD=A3=E5=BC=8F=E7=89=88?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E5=95=8F=E9=A1=8C=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 7 +- storage/api-docs/api-docs.json | 509 --------------------------------- 2 files changed, 4 insertions(+), 512 deletions(-) delete mode 100644 storage/api-docs/api-docs.json diff --git a/.env.example b/.env.example index 074546c..9a6aecd 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,8 @@ APP_ENV=local APP_KEY= APP_DEBUG=true APP_TIMEZONE=Asia/Taipei -APP_URL=https://KTV.test +APP_URL=https://superstar.dnsnet.cc +L5_SWAGGER_CONST_HOST=https://superstar.dnsnet.cc/ APP_LOCALE=zh-tw APP_FALLBACK_LOCALE=zh-tw @@ -21,8 +22,8 @@ LOG_STACK=single LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug -DB_CONNECTION=mariadb -DB_HOST=192.168.22.170 +DB_CONNECTION=mysql +DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=Karaoke-Kingpin DB_USERNAME=Karaoke-Kingpin diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json deleted file mode 100644 index e43a1dd..0000000 --- a/storage/api-docs/api-docs.json +++ /dev/null @@ -1,509 +0,0 @@ -{ - "openapi": "3.0.0", - "info": { - "title": "My API", - "description": "API documentation using L5 Swagger", - "version": "1.0.0" - }, - "servers": [ - { - "url": "https://KTV.test/", - "description": "API Server" - } - ], - "paths": { - "/api/artists/search": { - "get": { - "tags": [ - "Artist" - ], - "summary": "搜尋藝人名稱", - "operationId": "f96ef111c1fadd6241138fd9840bf697", - "parameters": [ - { - "name": "search", - "in": "query", - "description": "關鍵字搜尋藝人名稱", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "selected", - "in": "query", - "description": "已選擇藝人 ID 陣列", - "required": false, - "schema": { - "type": "array", - "items": { - "type": "integer" - } - } - } - ], - "responses": { - "200": { - "description": "搜尋結果" - } - } - } - }, - "/api/profile": { - "get": { - "tags": [ - "Auth" - ], - "summary": "Get current user profile", - "operationId": "d32e56b6274eb68e980da6d91fbe9fd8", - "parameters": [ - { - "name": "Accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "default": "application/json" - } - } - ], - "responses": { - "200": { - "description": "User profile", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - }, - { - "properties": { - "data": { - "$ref": "#/components/schemas/User" - } - }, - "type": "object" - } - ] - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - }, - { - "properties": { - "code": { - "type": "string", - "example": "UNAUTHORIZED" - }, - "message": { - "type": "string", - "example": "Unauthorized" - }, - "data": { - "type": "null" - } - }, - "type": "object" - } - ] - } - } - } - } - }, - "security": [ - { - "Authorization": [] - } - ] - } - }, - "/api/room/receiveRegister": { - "post": { - "tags": [ - "Room Control" - ], - "summary": "包廂註冊控制指令", - "description": "依據傳入的 branch_id 與 room_name,知道過來的設備來之於那個IP設備。", - "operationId": "registerRoomCommand", - "parameters": [ - { - "name": "Accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "default": "application/json" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReceiveRoomRegisterRequest" - } - } - } - }, - "responses": { - "200": { - "description": "成功傳送指令並回傳 TCP 回應", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - }, - { - "properties": { - "data": { - "$ref": "#/components/schemas/Room" - } - }, - "type": "object" - } - ] - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - }, - { - "properties": { - "code": { - "type": "string", - "example": "UNAUTHORIZED" - }, - "message": { - "type": "string", - "example": "Unauthorized" - }, - "data": { - "type": "null" - } - }, - "type": "object" - } - ] - } - } - } - } - }, - "security": [ - { - "Authorization": [] - } - ] - } - }, - "/api/room/sendSwitch": { - "post": { - "tags": [ - "Room Control" - ], - "summary": "送出包廂控制指令", - "description": "依據傳入的 room_id 與 command,透過 TCP 傳送對應指令給包廂電腦。", - "operationId": "sendRoomSwitchCommand", - "parameters": [ - { - "name": "Accept", - "in": "header", - "required": true, - "schema": { - "type": "string", - "default": "application/json" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SendRoomSwitchCommandRequest" - } - } - } - }, - "responses": { - "200": { - "description": "成功傳送指令並回傳 TCP 回應", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - }, - { - "properties": { - "data": { - "$ref": "#/components/schemas/Room" - } - }, - "type": "object" - } - ] - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "allOf": [ - { - "$ref": "#/components/schemas/ApiResponse" - }, - { - "properties": { - "code": { - "type": "string", - "example": "UNAUTHORIZED" - }, - "message": { - "type": "string", - "example": "Unauthorized" - }, - "data": { - "type": "null" - } - }, - "type": "object" - } - ] - } - } - } - } - }, - "security": [ - { - "Authorization": [] - } - ] - } - } - }, - "components": { - "schemas": { - "RoomStatus": { - "type": "string", - "enum": [ - "active", - "closed", - "fire", - "error", - "maintenance" - ], - "example": "error" - }, - "UserGender": { - "type": "string", - "enum": [ - "male", - "female", - "other", - "unset" - ], - "example": "male" - }, - "UserStatus": { - "description": "User status: 0=Active, 1=Suspended, 2=Deleting", - "type": "string", - "enum": [ - "Active", - "Suspended", - "Deleting" - ], - "example": "0" - }, - "ReceiveRoomRegisterRequest": { - "required": [ - "branch_id", - "room_id", - "ip" - ], - "properties": { - "branch_id": { - "type": "integer", - "example": "5" - }, - "room_name": { - "type": "string", - "example": "pc102" - }, - "ip": { - "type": "string", - "example": "192.168.x.x" - } - }, - "type": "object" - }, - "SendRoomSwitchCommandRequest": { - "required": [ - "room_id", - "command" - ], - "properties": { - "branch_id": { - "type": "integer", - "example": "5" - }, - "room_name": { - "type": "string", - "example": "pc102" - }, - "command": { - "type": "string", - "enum": [ - "active", - "closed", - "maintenance" - ], - "example": "active" - }, - "started_at": { - "type": "string", - "example": "2025-05-19 09:31:00", - "nullable": true - }, - "ended_at": { - "type": "string", - "example": "2025-05-19 09:31:00", - "nullable": true - } - }, - "type": "object" - }, - "ApiResponse": { - "properties": { - "code": { - "type": "string", - "example": "OK" - }, - "message": { - "type": "string", - "example": "Success" - }, - "data": { - "type": "object", - "nullable": true - } - }, - "type": "object" - }, - "Room": { - "properties": { - "id": { - "type": "integer", - "example": 16 - }, - "name": { - "type": "string", - "example": "pc102" - }, - "internal_ip": { - "type": "string", - "example": "192.168.11.7" - }, - "port": { - "type": "integer", - "example": "9000" - }, - "status": { - "$ref": "#/components/schemas/RoomStatus" - }, - "started_at": { - "type": "string", - "format": "date-time", - "example": "2025-05-11T16:00:00.000000Z" - }, - "ended_at": { - "type": "string", - "format": "date-time", - "example": null - } - }, - "type": "object" - }, - "User": { - "properties": { - "id": { - "type": "integer", - "example": 1 - }, - "name": { - "type": "string", - "example": "John Doe" - }, - "email": { - "type": "string", - "example": "john@example.com" - }, - "phone": { - "type": "string", - "example": "0900000000" - }, - "birthday": { - "type": "string", - "format": "date-time", - "example": "2025-05-11T16:00:00.000000Z" - }, - "gender": { - "$ref": "#/components/schemas/UserGender" - }, - "status": { - "$ref": "#/components/schemas/UserStatus" - } - }, - "type": "object" - } - }, - "securitySchemes": { - "Authorization": { - "type": "http", - "bearerFormat": "JWT", - "scheme": "bearer" - } - } - }, - "tags": [ - { - "name": "Artist", - "description": "藝人資料搜尋" - }, - { - "name": "Auth", - "description": "包廂控制" - }, - { - "name": "Room Control", - "description": "Room Control" - } - ] -} \ No newline at end of file