egg_server/types/context.ts

28 lines
804 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 { AppInfoModel } from "../constant/config"
import functionMap from "../constant/function"
import tempMap from "../constant/template"
import { AttachService } from "../services"
export interface Context {
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: AppInfoModel
}