commit 3aab251c77cbd76451676b0cab3283cf345b0043 Author: JianMiau Date: Thu Aug 31 16:59:11 2023 +0800 [add] first diff --git a/MsgChat.ts b/MsgChat.ts new file mode 100644 index 0000000..c879648 --- /dev/null +++ b/MsgChat.ts @@ -0,0 +1,7 @@ +// This is a demo code file +// Feel free to delete it + +export interface MsgChat { + content: string, + time: Date +} \ No newline at end of file diff --git a/PtlSend.ts b/PtlSend.ts new file mode 100644 index 0000000..6a5d9f6 --- /dev/null +++ b/PtlSend.ts @@ -0,0 +1,10 @@ +// This is a demo code file +// Feel free to delete it + +export interface ReqSend { + content: string +} + +export interface ResSend { + time: Date +} \ No newline at end of file diff --git a/base.ts b/base.ts new file mode 100644 index 0000000..4626ca8 --- /dev/null +++ b/base.ts @@ -0,0 +1,15 @@ +export interface BaseRequest { + +} + +export interface BaseResponse { + +} + +export interface BaseConf { + +} + +export interface BaseMessage { + +} \ No newline at end of file diff --git a/serviceProto.ts b/serviceProto.ts new file mode 100644 index 0000000..854cea5 --- /dev/null +++ b/serviceProto.ts @@ -0,0 +1,78 @@ +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" + } + } + ] + } + } +}; \ No newline at end of file