This commit is contained in:
建喵 2023-08-31 19:28:49 +08:00
parent 3aab251c77
commit 3afa608a37
3 changed files with 133 additions and 77 deletions

5
PtlAccountLogin.ts Normal file
View File

@ -0,0 +1,5 @@
export interface ReqAccountLogin {
name: string
}
export type ResAccountLogin = number

3
PtlLobbyList.ts Normal file
View File

@ -0,0 +1,3 @@
export type ReqLobbyList = null
export type ResLobbyList = any[]

View File

@ -1,78 +1,126 @@
import { ServiceProto } from 'tsrpc-proto'; import { ServiceProto } from 'tsrpc-proto';
import { MsgChat } from './MsgChat'; import { MsgChat } from './MsgChat';
import { ReqSend, ResSend } from './PtlSend'; import { ReqAccountLogin, ResAccountLogin } from './PtlAccountLogin';
import { ReqLobbyList, ResLobbyList } from './PtlLobbyList';
// This is a demo service proto file (auto generated) import { ReqSend, ResSend } from './PtlSend';
// Feel free to delete it
export interface ServiceType {
export interface ServiceType { api: {
api: { "AccountLogin": {
"Send": { req: ReqAccountLogin,
req: ReqSend, res: ResAccountLogin
res: ResSend },
} "LobbyList": {
}, req: ReqLobbyList,
msg: { res: ResLobbyList
"Chat": MsgChat },
} "Send": {
} req: ReqSend,
res: ResSend
export const serviceProto: ServiceProto<ServiceType> = { }
"services": [ },
{ msg: {
"id": 0, "Chat": MsgChat
"name": "Chat", }
"type": "msg" }
},
{ export const serviceProto: ServiceProto<ServiceType> = {
"id": 1, "version": 2,
"name": "Send", "services": [
"type": "api" {
} "id": 0,
], "name": "Chat",
"types": { "type": "msg"
"MsgChat/MsgChat": { },
"type": "Interface", {
"properties": [ "id": 2,
{ "name": "AccountLogin",
"id": 0, "type": "api"
"name": "content", },
"type": { {
"type": "String" "id": 3,
} "name": "LobbyList",
}, "type": "api"
{ },
"id": 1, {
"name": "time", "id": 1,
"type": { "name": "Send",
"type": "Date" "type": "api"
} }
} ],
] "types": {
}, "MsgChat/MsgChat": {
"PtlSend/ReqSend": { "type": "Interface",
"type": "Interface", "properties": [
"properties": [ {
{ "id": 0,
"id": 0, "name": "content",
"name": "content", "type": {
"type": { "type": "String"
"type": "String" }
} },
} {
] "id": 1,
}, "name": "time",
"PtlSend/ResSend": { "type": {
"type": "Interface", "type": "Date"
"properties": [ }
{ }
"id": 0, ]
"name": "time", },
"type": { "PtlAccountLogin/ReqAccountLogin": {
"type": "Date" "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"
}
}
]
}
}
}; };