GuessWhoIAmS/docs/openapi.json
2023-09-11 12:14:17 +08:00

475 lines
12 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"openapi": "3.0.0",
"info": {
"title": "TSRPC Open API",
"version": "1.0.0"
},
"paths": {
"/account/Login": {
"post": {
"tags": [
"account"
],
"operationId": "account/Login",
"requestBody": {
"description": "Req<Login>",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/account_PtlLogin_ReqLogin"
}
}
}
},
"responses": {
"200": {
"description": "Success",
"content": {
"application/json": {
"schema": {
"type": "object",
"description": "ApiReturn<ResLogin>",
"properties": {
"isSucc": {
"type": "boolean",
"enum": [
true
],
"default": true
},
"res": {
"$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"
}
}
}
}
}
},
"default": {
"description": "Error",
"$ref": "#/components/responses/error"
}
}
}
}
},
"components": {
"schemas": {
"account_PtlLogin_ReqLogin": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
},
"account_PtlLogin_ResLogin": {
"type": "number"
},
"MsgChat_MsgChat": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"time": {
"type": "string",
"format": "date-time"
}
},
"required": [
"content",
"time"
]
},
"room_MsgChangeState_MsgChangeState": {
"type": "number"
},
"room_MsgExit_MsgExit": {
"type": "number"
},
"room_MsgGoToGame_MsgGoToGame": {
"type": "number"
},
"room_PtlChangeState_ReqChangeState": {
"type": "object",
"properties": {
"state": {
"type": "number"
}
},
"required": [
"state"
]
},
"room_PtlChangeState_ResChangeState": {
"type": "number"
},
"room_PtlCreate_ReqCreate": {
"type": "object",
"properties": {
"null": {
"type": "string"
}
},
"required": [
"null"
]
},
"room_PtlCreate_ResCreate": {
"type": "number"
},
"room_PtlExit_ReqExit": {
"type": "object",
"properties": {
"null": {
"type": "string"
}
},
"required": [
"null"
]
},
"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"
}
},
"?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"
]
}
}
}
}
}
}
}
}
}