docs: 重新生成 swagger 接口文档
This commit is contained in:
@@ -0,0 +1,549 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "",
|
||||
"version": ""
|
||||
},
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {
|
||||
"/api/v1/favorites": {
|
||||
"get": {
|
||||
"summary": "获取收藏列表",
|
||||
"operationId": "ListFavorites",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/FavoriteListResp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "0"
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "20"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"favorites"
|
||||
],
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
]
|
||||
},
|
||||
"post": {
|
||||
"summary": "添加收藏",
|
||||
"operationId": "AddFavorite",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/EmptyResp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/FavoriteReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"favorites"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/favorites/{id}": {
|
||||
"delete": {
|
||||
"summary": "取消收藏",
|
||||
"operationId": "RemoveFavorite",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/EmptyResp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "body",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/PathIDReq"
|
||||
}
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"favorites"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/recommendations/home": {
|
||||
"get": {
|
||||
"summary": "首页推荐",
|
||||
"operationId": "Recommendations",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/SearchResp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "0"
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "20"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/search": {
|
||||
"get": {
|
||||
"summary": "统一搜索",
|
||||
"operationId": "Search",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/SearchResp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "offset",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "0"
|
||||
},
|
||||
{
|
||||
"name": "limit",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "20"
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "min",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
{
|
||||
"name": "max",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
{
|
||||
"name": "onlyOnline",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean",
|
||||
"format": "boolean"
|
||||
},
|
||||
{
|
||||
"name": "sort",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"search"
|
||||
],
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v1/users/{id}/favorites/check": {
|
||||
"get": {
|
||||
"summary": "检查收藏状态",
|
||||
"operationId": "CheckFavorite",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "A successful response.",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/FavoriteCheckResp"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
{
|
||||
"name": "targetType",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "targetId",
|
||||
"in": "query",
|
||||
"required": true,
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"favorites"
|
||||
],
|
||||
"consumes": [
|
||||
"multipart/form-data"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
"EmptyResp": {
|
||||
"type": "object",
|
||||
"title": "EmptyResp"
|
||||
},
|
||||
"Favorite": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"userId": {
|
||||
"type": "string"
|
||||
},
|
||||
"targetType": {
|
||||
"type": "string"
|
||||
},
|
||||
"targetId": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "Favorite",
|
||||
"required": [
|
||||
"id",
|
||||
"userId",
|
||||
"targetType",
|
||||
"targetId",
|
||||
"createdAt"
|
||||
]
|
||||
},
|
||||
"FavoriteCheckReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"targetType": {
|
||||
"type": "string"
|
||||
},
|
||||
"targetId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "FavoriteCheckReq",
|
||||
"required": [
|
||||
"targetType",
|
||||
"targetId"
|
||||
]
|
||||
},
|
||||
"FavoriteCheckResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"favorited": {
|
||||
"type": "boolean",
|
||||
"format": "boolean"
|
||||
}
|
||||
},
|
||||
"title": "FavoriteCheckResp",
|
||||
"required": [
|
||||
"favorited"
|
||||
]
|
||||
},
|
||||
"FavoriteListResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/Favorite"
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "#/definitions/PageMeta"
|
||||
}
|
||||
},
|
||||
"title": "FavoriteListResp",
|
||||
"required": [
|
||||
"items",
|
||||
"meta"
|
||||
]
|
||||
},
|
||||
"FavoriteReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"targetType": {
|
||||
"type": "string",
|
||||
"description": " player, shop"
|
||||
},
|
||||
"targetId": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "FavoriteReq",
|
||||
"required": [
|
||||
"targetType",
|
||||
"targetId"
|
||||
]
|
||||
},
|
||||
"PageMeta": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"total": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
}
|
||||
},
|
||||
"title": "PageMeta",
|
||||
"required": [
|
||||
"total",
|
||||
"offset",
|
||||
"limit"
|
||||
]
|
||||
},
|
||||
"PageReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "0"
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "20"
|
||||
}
|
||||
},
|
||||
"title": "PageReq",
|
||||
"required": [
|
||||
"offset",
|
||||
"limit"
|
||||
]
|
||||
},
|
||||
"PathIDReq": {
|
||||
"type": "object",
|
||||
"title": "PathIDReq"
|
||||
},
|
||||
"SearchReq": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"offset": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "0"
|
||||
},
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"default": "20"
|
||||
},
|
||||
"q": {
|
||||
"type": "string"
|
||||
},
|
||||
"min": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"max": {
|
||||
"type": "number",
|
||||
"format": "double"
|
||||
},
|
||||
"onlyOnline": {
|
||||
"type": "boolean",
|
||||
"format": "boolean"
|
||||
},
|
||||
"sort": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "SearchReq"
|
||||
},
|
||||
"SearchResp": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object"
|
||||
},
|
||||
"description": " Mixed items"
|
||||
},
|
||||
"meta": {
|
||||
"$ref": "#/definitions/PageMeta"
|
||||
}
|
||||
},
|
||||
"title": "SearchResp",
|
||||
"required": [
|
||||
"items",
|
||||
"meta"
|
||||
]
|
||||
},
|
||||
"SimpleUser": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "SimpleUser",
|
||||
"required": [
|
||||
"id",
|
||||
"nickname",
|
||||
"avatar"
|
||||
]
|
||||
},
|
||||
"UserProfile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string"
|
||||
},
|
||||
"username": {
|
||||
"type": "string"
|
||||
},
|
||||
"nickname": {
|
||||
"type": "string"
|
||||
},
|
||||
"avatar": {
|
||||
"type": "string"
|
||||
},
|
||||
"role": {
|
||||
"type": "string",
|
||||
"description": " consumer, player, owner, admin"
|
||||
},
|
||||
"verifiedRoles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"verificationStatus": {
|
||||
"type": "object"
|
||||
},
|
||||
"phone": {
|
||||
"type": "string"
|
||||
},
|
||||
"bio": {
|
||||
"type": "string"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "UserProfile",
|
||||
"required": [
|
||||
"id",
|
||||
"username",
|
||||
"nickname",
|
||||
"avatar",
|
||||
"role",
|
||||
"verifiedRoles",
|
||||
"verificationStatus",
|
||||
"createdAt"
|
||||
]
|
||||
}
|
||||
},
|
||||
"securityDefinitions": {
|
||||
"apiKey": {
|
||||
"type": "apiKey",
|
||||
"description": "Enter JWT Bearer token **_only_**",
|
||||
"name": "Authorization",
|
||||
"in": "header"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user