{ "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", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/account_PtlLogin_ReqLogin" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "ApiReturn", "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", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/room_PtlChangeState_ReqChangeState" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "ApiReturn", "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", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/room_PtlCreate_ReqCreate" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "ApiReturn", "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", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/room_PtlExit_ReqExit" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "ApiReturn", "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", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/room_PtlJoin_ReqJoin" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "ApiReturn", "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", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/room_PtlList_ReqList" } } } }, "responses": { "200": { "description": "Success", "content": { "application/json": { "schema": { "type": "object", "description": "ApiReturn", "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" ] } } } } } } } } }