feat: add web package

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-06-17 18:34:20 +08:00
parent 8a07e85fda
commit 2c1eea5bc1
10 changed files with 299 additions and 0 deletions

View File

@ -0,0 +1,19 @@
export type RequestHandler = (ctx: Context) => any
export interface InterceptorAdapter {
name: string
preHandle?(ctx: Context): void
postHandle?(ctx: Context): void
}
export type RequestHeader = { [key: string]: string | string[] }
export type RequestParams = { [key: string]: string | string[] }
export interface Context {
request?: javax.servlet.http.HttpServletRequest
response?: javax.servlet.http.HttpServletResponse
header?: RequestHeader
url?: string
params?: RequestParams
body?: any
result?: any
}