GuessWhoIAmS/docs/openapi.json

475 lines
12 KiB
JSON
Raw Normal View History

2023-08-31 11:28:35 +00:00
{
"openapi": "3.0.0",
"info": {
"title": "TSRPC Open API",
"version": "1.0.0"
},
"paths": {
2023-09-11 04:14:17 +00:00
"/account/Login": {
2023-08-31 11:28:35 +00:00
"post": {
2023-09-11 04:14:17 +00:00
"tags": [
"account"
],
"operationId": "account/Login",
2023-08-31 11:28:35 +00:00
"requestBody": {
2023-09-11 04:14:17 +00:00
"description": "Req<Login>",
2023-08-31 11:28:35 +00:00
"content": {
"application/json": {
"schema": {
2023-09-11 04:14:17 +00:00
"$ref": "#/components/schemas/account_PtlLogin_ReqLogin"
2023-08-31 11:28:35 +00:00
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
2023-09-11 04:14:17 +00:00
"description": "ApiReturn<ResLogin>",
2023-08-31 11:28:35 +00:00
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
2023-09-11 04:14:17 +00:00
"$ref": "#/components/schemas/account_PtlLogin_ResLogin"
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
},
"/room/ChangeState": {
"post": {
"tags": [
"room"
],
"operationId": "room/ChangeState",
"requestBody": {
"description": "Req<ChangeState>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/room_PtlChangeState_ReqChangeState"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "ApiReturn<ResChangeState>",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
"$ref": "#/components/schemas/room_PtlChangeState_ResChangeState"
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
},
"/room/Create": {
"post": {
"tags": [
"room"
],
"operationId": "room/Create",
"requestBody": {
"description": "Req<Create>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/room_PtlCreate_ReqCreate"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "ApiReturn<ResCreate>",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
"$ref": "#/components/schemas/room_PtlCreate_ResCreate"
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
},
"/room/Exit": {
"post": {
"tags": [
"room"
],
"operationId": "room/Exit",
"requestBody": {
"description": "Req<Exit>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/room_PtlExit_ReqExit"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "ApiReturn<ResExit>",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
"$ref": "#/components/schemas/room_PtlExit_ResExit"
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
},
"/room/Join": {
"post": {
"tags": [
"room"
],
"operationId": "room/Join",
"requestBody": {
"description": "Req<Join>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/room_PtlJoin_ReqJoin"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "ApiReturn<ResJoin>",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
"$ref": "#/components/schemas/room_PtlJoin_ResJoin"
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
},
"/room/List": {
"post": {
"tags": [
"room"
],
"operationId": "room/List",
"requestBody": {
"description": "Req<List>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/room_PtlList_ReqList"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "ApiReturn<ResList>",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
"$ref": "#/components/schemas/room_PtlList_ResList"
2023-08-31 11:28:35 +00:00
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
}
},
"components": {
"schemas": {
2023-09-11 04:14:17 +00:00
"account_PtlLogin_ReqLogin": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
},
"account_PtlLogin_ResLogin": {
"type": "number"
},
2023-08-31 11:28:35 +00:00
"MsgChat_MsgChat": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"time": {
"type": "string",
"format": "date-time"
}
},
"required": [
"content",
"time"
]
},
2023-09-11 04:14:17 +00:00
"room_MsgChangeState_MsgChangeState": {
"type": "number"
},
"room_MsgExit_MsgExit": {
"type": "number"
},
"room_MsgGoToGame_MsgGoToGame": {
"type": "number"
},
"room_PtlChangeState_ReqChangeState": {
2023-08-31 11:28:35 +00:00
"type": "object",
"properties": {
2023-09-11 04:14:17 +00:00
"state": {
"type": "number"
}
},
"required": [
"state"
]
},
"room_PtlChangeState_ResChangeState": {
"type": "number"
},
"room_PtlCreate_ReqCreate": {
"type": "object",
"properties": {
"null": {
2023-08-31 11:28:35 +00:00
"type": "string"
}
},
"required": [
2023-09-11 04:14:17 +00:00
"null"
2023-08-31 11:28:35 +00:00
]
},
2023-09-11 04:14:17 +00:00
"room_PtlCreate_ResCreate": {
"type": "number"
},
"room_PtlExit_ReqExit": {
2023-08-31 11:28:35 +00:00
"type": "object",
"properties": {
2023-09-11 04:14:17 +00:00
"null": {
"type": "string"
2023-08-31 11:28:35 +00:00
}
},
"required": [
2023-09-11 04:14:17 +00:00
"null"
2023-08-31 11:28:35 +00:00
]
},
2023-09-11 04:14:17 +00:00
"room_PtlExit_ResExit": {
"type": "number"
},
"room_PtlJoin_ReqJoin": {
"type": "object",
"properties": {
"roomId": {
"type": "number"
}
},
"required": [
"roomId"
]
},
"room_PtlJoin_ResJoin": {
"type": "number"
},
"room_PtlList_ReqList": {
"type": "object",
"properties": {
"null": {
"type": "string"
}
},
"required": [
"null"
]
},
"room_PtlList_ResList": {
"type": "array",
"items": {
"type": "object"
}
},
2023-08-31 11:28:35 +00:00
"?bson_ObjectID": {
"type": "string"
},
"?bson_ObjectId": {
"type": "string"
},
"?mongodb_ObjectID": {
"type": "string"
},
"?mongodb_ObjectId": {
"type": "string"
}
},
"responses": {
"error": {
"description": "Error",
"content": {
"application/json": {
"schema": {
"type": "object",
"title": "API 错误",
"description": "业务错误ApiError返回 HTTP 状态码 200其它错误返回 HTTP 状态码 500",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
false
],
"default": false
},
"err": {
"type": "object",
"description": "TsrpcError",
"properties": {
"message": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"ApiError",
"NetworkError",
"ServerError",
"ClientError"
]
},
"code": {
"oneOf": [
{
"type": "string"
},
{
"type": "integer"
}
],
"nullable": true
}
},
"required": [
"message",
"type"
]
}
}
}
}
}
}
}
}
}