From 3afa608a37101df11bef65072659bcec7b4e96f7 Mon Sep 17 00:00:00 2001 From: JianMiau Date: Thu, 31 Aug 2023 19:28:49 +0800 Subject: [PATCH] [add] --- PtlAccountLogin.ts | 5 ++ PtlLobbyList.ts | 3 + serviceProto.ts | 202 ++++++++++++++++++++++++++++----------------- 3 files changed, 133 insertions(+), 77 deletions(-) create mode 100644 PtlAccountLogin.ts create mode 100644 PtlLobbyList.ts diff --git a/PtlAccountLogin.ts b/PtlAccountLogin.ts new file mode 100644 index 0000000..27079fb --- /dev/null +++ b/PtlAccountLogin.ts @@ -0,0 +1,5 @@ +export interface ReqAccountLogin { + name: string +} + +export type ResAccountLogin = number \ No newline at end of file diff --git a/PtlLobbyList.ts b/PtlLobbyList.ts new file mode 100644 index 0000000..c98921a --- /dev/null +++ b/PtlLobbyList.ts @@ -0,0 +1,3 @@ +export type ReqLobbyList = null + +export type ResLobbyList = any[] \ No newline at end of file diff --git a/serviceProto.ts b/serviceProto.ts index 854cea5..9f1688a 100644 --- a/serviceProto.ts +++ b/serviceProto.ts @@ -1,78 +1,126 @@ -import { ServiceProto } from 'tsrpc-proto'; -import { MsgChat } from './MsgChat'; -import { ReqSend, ResSend } from './PtlSend'; - -// This is a demo service proto file (auto generated) -// Feel free to delete it - -export interface ServiceType { - api: { - "Send": { - req: ReqSend, - res: ResSend - } - }, - msg: { - "Chat": MsgChat - } -} - -export const serviceProto: ServiceProto = { - "services": [ - { - "id": 0, - "name": "Chat", - "type": "msg" - }, - { - "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" - } - } - ] - }, - "PtlSend/ReqSend": { - "type": "Interface", - "properties": [ - { - "id": 0, - "name": "content", - "type": { - "type": "String" - } - } - ] - }, - "PtlSend/ResSend": { - "type": "Interface", - "properties": [ - { - "id": 0, - "name": "time", - "type": { - "type": "Date" - } - } - ] - } - } +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 = { + "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" + } + } + ] + } + } }; \ No newline at end of file