egg_server/types/context.ts

32 lines
901 B
TypeScript

import { LarkBody, LarkCard } from "@egg/lark-msg-tool"
import { GitlabService, 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 DB from "../db"
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
gitlabService: GitlabService
path: PathCheckTool
searchParams: URLSearchParams
headers: Headers
app: "michat" | "egg" | string
appInfo: AppInfoModel
db: DB
}