examples to new tsrpc-cli

This commit is contained in:
King Wang
2021-10-07 15:30:02 +08:00
parent c21445548e
commit 69a90884d5
86 changed files with 652 additions and 1697 deletions

View File

@@ -0,0 +1 @@
../../backend/src/shared

View File

@@ -1,8 +0,0 @@
export interface ReqHello {
name: string
}
export interface ResHello {
reply: string,
time: Date
}

View File

@@ -1,57 +0,0 @@
import { ServiceProto } from 'tsrpc-proto';
import { ReqHello, ResHello } from './PtlHello';
export interface ServiceType {
api: {
"Hello": {
req: ReqHello,
res: ResHello
}
},
msg: {
}
}
export const serviceProto: ServiceProto<ServiceType> = {
"services": [
{
"id": 0,
"name": "Hello",
"type": "api"
}
],
"types": {
"PtlHello/ReqHello": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "name",
"type": {
"type": "String"
}
}
]
},
"PtlHello/ResHello": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "reply",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "time",
"type": {
"type": "Date"
}
}
]
}
}
};