Protocols/serviceProto.ts
2023-08-31 19:53:25 +08:00

121 lines
2.9 KiB
TypeScript

import { ServiceProto } from 'tsrpc-proto';
import { MsgChat } from './MsgChat';
import { ReqAccountLogin, ResAccountLogin } from './PtlAccountLogin';
import { ReqLobbyList, ResLobbyList } from './PtlLobbyList';
import { ReqSend, ResSend } from './PtlSend';
export interface ServiceType {
api: {
"AccountLogin": {
req: ReqAccountLogin,
res: ResAccountLogin
},
"LobbyList": {
req: ReqLobbyList,
res: ResLobbyList
},
"Send": {
req: ReqSend,
res: ResSend
}
},
msg: {
"Chat": MsgChat
}
}
export const serviceProto: ServiceProto<ServiceType> = {
"version": 4,
"services": [
{
"id": 0,
"name": "Chat",
"type": "msg"
},
{
"id": 2,
"name": "AccountLogin",
"type": "api"
},
{
"id": 3,
"name": "LobbyList",
"type": "api"
},
{
"id": 1,
"name": "Send",
"type": "api"
}
],
"types": {
"MsgChat/MsgChat": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "time",
"type": {
"type": "Date"
}
}
]
},
"PtlAccountLogin/ReqAccountLogin": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "name",
"type": {
"type": "String"
}
}
]
},
"PtlAccountLogin/ResAccountLogin": {
"type": "Number"
},
"PtlLobbyList/ReqLobbyList": {
"type": "Literal",
"literal": null
},
"PtlLobbyList/ResLobbyList": {
"type": "Array",
"elementType": {
"type": "Any"
}
},
"PtlSend/ReqSend": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "content",
"type": {
"type": "String"
}
}
]
},
"PtlSend/ResSend": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "time",
"type": {
"type": "Date"
}
}
]
}
}
};