Protocols/serviceProto.ts

227 lines
3.7 KiB
TypeScript
Raw Normal View History

2023-09-10 07:17:58 +00:00
import { ServiceProto } from "tsrpc-proto";
import { ReqLogin, ResLogin } from "./account/PtlLogin";
import { MsgChat } from "./MsgChat";
2023-09-10 11:33:38 +00:00
import { MsgChangeState } from "./room/MsgChangeState";
2023-09-10 07:17:58 +00:00
import { MsgExit } from "./room/MsgExit";
import { MsgGoToGame } from "./room/MsgGoToGame";
2023-09-10 11:33:38 +00:00
import { ReqChangeState, ResChangeState } from "./room/PtlChangeState";
2023-09-10 07:17:58 +00:00
import { ReqCreate, ResCreate } from "./room/PtlCreate";
import { ReqExit, ResExit } from "./room/PtlExit";
import { ReqJoin, ResJoin } from "./room/PtlJoin";
import { ReqList, ResList } from "./room/PtlList";
2023-08-31 11:28:49 +00:00
export interface ServiceType {
2023-09-10 07:17:58 +00:00
api: {
"account/Login": {
req: ReqLogin,
res: ResLogin
},
2023-09-10 11:33:38 +00:00
"room/ChangeState": {
req: ReqChangeState,
res: ResChangeState
},
2023-09-10 07:17:58 +00:00
"room/Create": {
req: ReqCreate,
res: ResCreate
},
"room/Exit": {
req: ReqExit,
res: ResExit
},
"room/Join": {
req: ReqJoin,
res: ResJoin
},
"room/List": {
req: ReqList,
res: ResList
}
},
msg: {
"Chat": MsgChat,
2023-09-10 11:33:38 +00:00
"room/ChangeState": MsgChangeState,
2023-09-10 07:17:58 +00:00
"room/Exit": MsgExit,
"room/GoToGame": MsgGoToGame
}
2023-08-31 11:28:49 +00:00
}
export const serviceProto: ServiceProto<ServiceType> = {
2023-09-10 07:17:58 +00:00
"services": [
{
2023-09-11 04:14:29 +00:00
"id": 0,
2023-09-10 07:17:58 +00:00
"name": "account/Login",
"type": "api"
},
{
2023-09-11 04:14:29 +00:00
"id": 1,
2023-09-10 07:17:58 +00:00
"name": "Chat",
"type": "msg"
},
2023-09-10 11:33:38 +00:00
{
2023-09-11 04:14:29 +00:00
"id": 2,
2023-09-10 11:33:38 +00:00
"name": "room/ChangeState",
"type": "msg"
},
2023-09-10 07:17:58 +00:00
{
2023-09-11 04:14:29 +00:00
"id": 3,
2023-09-10 07:17:58 +00:00
"name": "room/Exit",
"type": "msg"
},
{
2023-09-11 04:14:29 +00:00
"id": 4,
2023-09-10 07:17:58 +00:00
"name": "room/GoToGame",
"type": "msg"
},
2023-09-10 11:33:38 +00:00
{
2023-09-11 04:14:29 +00:00
"id": 5,
2023-09-10 11:33:38 +00:00
"name": "room/ChangeState",
"type": "api"
},
2023-09-10 07:17:58 +00:00
{
"id": 6,
"name": "room/Create",
"type": "api"
},
{
"id": 7,
"name": "room/Exit",
"type": "api"
},
{
"id": 8,
"name": "room/Join",
"type": "api"
},
{
"id": 9,
"name": "room/List",
"type": "api"
}
],
"types": {
"account/PtlLogin/ReqLogin": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "name",
"type": {
"type": "String"
}
}
]
},
"account/PtlLogin/ResLogin": {
"type": "Number"
},
"MsgChat/MsgChat": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "time",
"type": {
"type": "Date"
}
}
]
},
2023-09-10 11:33:38 +00:00
"room/MsgChangeState/MsgChangeState": {
2023-09-11 04:14:29 +00:00
"type": "Array",
"elementType": {
"type": "Any"
}
2023-09-10 11:33:38 +00:00
},
2023-09-10 07:17:58 +00:00
"room/MsgExit/MsgExit": {
"type": "Number"
},
"room/MsgGoToGame/MsgGoToGame": {
"type": "Number"
},
2023-09-10 11:33:38 +00:00
"room/PtlChangeState/ReqChangeState": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "state",
"type": {
"type": "Number"
}
}
]
},
"room/PtlChangeState/ResChangeState": {
"type": "Number"
},
2023-09-10 07:17:58 +00:00
"room/PtlCreate/ReqCreate": {
"type": "Interface",
"properties": [
{
2023-09-11 04:14:29 +00:00
"id": 0,
2023-09-10 07:17:58 +00:00
"name": "null",
"type": {
"type": "String"
}
}
]
},
"room/PtlCreate/ResCreate": {
"type": "Number"
},
"room/PtlExit/ReqExit": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "null",
"type": {
"type": "String"
}
}
]
},
"room/PtlExit/ResExit": {
"type": "Number"
},
"room/PtlJoin/ReqJoin": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "roomId",
"type": {
"type": "Number"
}
}
]
},
"room/PtlJoin/ResJoin": {
"type": "Number"
},
"room/PtlList/ReqList": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "null",
"type": {
"type": "String"
}
}
]
},
"room/PtlList/ResList": {
"type": "Array",
"elementType": {
"type": "Any"
}
}
}
2023-08-31 08:59:11 +00:00
};