222 lines
7.6 KiB
JSON
222 lines
7.6 KiB
JSON
|
{
|
||
|
"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": []
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
},
|
||
|
"components": {
|
||
|
"schemas": {
|
||
|
"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"
|
||
|
},
|
||
|
"ApiResponse": {
|
||
|
"properties": {
|
||
|
"code": {
|
||
|
"type": "string",
|
||
|
"example": "OK"
|
||
|
},
|
||
|
"message": {
|
||
|
"type": "string",
|
||
|
"example": "Success"
|
||
|
},
|
||
|
"data": {
|
||
|
"type": "object",
|
||
|
"nullable": true
|
||
|
}
|
||
|
},
|
||
|
"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": "用戶註冊、登入、登出與個人資料"
|
||
|
}
|
||
|
]
|
||
|
}
|