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

@@ -7,15 +7,15 @@
"build": "webpack --mode=production"
},
"devDependencies": {
"copy-webpack-plugin": "^9.0.0",
"html-webpack-plugin": "^5.3.1",
"ts-loader": "^9.2.3",
"typescript": "^4.3.4",
"webpack": "^5.39.1",
"webpack-cli": "^4.7.2",
"copy-webpack-plugin": "^9.0.1",
"html-webpack-plugin": "^5.3.2",
"ts-loader": "^9.2.6",
"typescript": "^4.4.3",
"webpack": "^5.57.1",
"webpack-cli": "^4.9.0",
"webpack-dev-server": "^3.11.2"
},
"dependencies": {
"tsrpc-browser": "^3.0.3"
"tsrpc-browser": "^3.0.7"
}
}

View File

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

View File

@@ -1,8 +0,0 @@
export interface ReqUpload {
fileName: string,
fileData: Uint8Array
}
export interface ResUpload {
url: string;
}

View File

@@ -1,59 +0,0 @@
import { ServiceProto } from 'tsrpc-proto';
import { ReqUpload, ResUpload } from './PtlUpload';
export interface ServiceType {
api: {
"Upload": {
req: ReqUpload,
res: ResUpload
}
},
msg: {
}
}
export const serviceProto: ServiceProto<ServiceType> = {
"version": 2,
"services": [
{
"id": 0,
"name": "Upload",
"type": "api"
}
],
"types": {
"PtlUpload/ReqUpload": {
"type": "Interface",
"properties": [
{
"id": 0,
"name": "fileName",
"type": {
"type": "String"
}
},
{
"id": 1,
"name": "fileData",
"type": {
"type": "Buffer",
"arrayType": "Uint8Array"
}
}
]
},
"PtlUpload/ResUpload": {
"type": "Interface",
"properties": [
{
"id": 2,
"name": "url",
"type": {
"type": "String"
}
}
]
}
}
};