egg_server/types/context.ts
2024-11-25 11:08:54 +00:00

35 lines
942 B
TypeScript

import { LarkBody, LarkCard } from "@egg/lark-msg-tool"
import { LarkService, NetTool } from "@egg/net-tool"
import { PathCheckTool } from "@egg/path-tool"
import { Logger } from "winston"
import cardMap from "../constant/card"
import functionMap from "../constant/function"
import tempMap from "../constant/template"
import { AttachService } from "../services"
export namespace Context {
export interface APP_INFO {
app_id: string
app_secret: string
app_name: string
}
export interface Data {
req: Request
requestId: string
logger: Logger
genResp: NetTool
body: any
text: string
larkService: LarkService
larkBody: LarkBody
larkCard: LarkCard<typeof cardMap, typeof tempMap, typeof functionMap>
attachService: AttachService
path: PathCheckTool
searchParams: URLSearchParams
app: "michat" | "egg" | string
appInfo: APP_INFO
appMap: Record<string, APP_INFO>
}
}