126 lines
3.0 KiB
TypeScript
126 lines
3.0 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": 2,
|
|
"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": "Interface",
|
|
"properties": [
|
|
{
|
|
"id": 0,
|
|
"name": "name",
|
|
"type": {
|
|
"type": "String"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"PtlLobbyList/ResLobbyList": {
|
|
"type": "Number"
|
|
},
|
|
"PtlSend/ReqSend": {
|
|
"type": "Interface",
|
|
"properties": [
|
|
{
|
|
"id": 0,
|
|
"name": "content",
|
|
"type": {
|
|
"type": "String"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"PtlSend/ResSend": {
|
|
"type": "Interface",
|
|
"properties": [
|
|
{
|
|
"id": 0,
|
|
"name": "time",
|
|
"type": {
|
|
"type": "Date"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}; |