Swagger 在正式版上的問題修正

This commit is contained in:
allen.yan 2025-05-19 17:21:39 +08:00
parent ae5ed4aa1f
commit 15ece8e7b5
2 changed files with 4 additions and 512 deletions

View File

@ -3,7 +3,8 @@ APP_ENV=local
APP_KEY= APP_KEY=
APP_DEBUG=true APP_DEBUG=true
APP_TIMEZONE=Asia/Taipei 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_LOCALE=zh-tw
APP_FALLBACK_LOCALE=zh-tw APP_FALLBACK_LOCALE=zh-tw
@ -21,8 +22,8 @@ LOG_STACK=single
LOG_DEPRECATIONS_CHANNEL=null LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug LOG_LEVEL=debug
DB_CONNECTION=mariadb DB_CONNECTION=mysql
DB_HOST=192.168.22.170 DB_HOST=127.0.0.1
DB_PORT=3306 DB_PORT=3306
DB_DATABASE=Karaoke-Kingpin DB_DATABASE=Karaoke-Kingpin
DB_USERNAME=Karaoke-Kingpin DB_USERNAME=Karaoke-Kingpin

View File

@ -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"
}
]
}