| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import 'fastify'
- import { DataSource } from 'typeorm'
- import Redis from 'ioredis'
- import { BannerStatisticsScheduler } from '../scheduler/banner-statistics.scheduler'
- declare module 'fastify' {
- interface FastifyInstance {
- config: {
- NODE_ENV: string
- PORT: number
- HOST: string
- JWT_SECRET: string
- JWT_EXPIRES_IN: string
- DB_HOST: string
- DB_PORT: string
- DB_USERNAME: string
- DB_PASSWORD: string
- DB_DATABASE: string
-
- // OSS配置
- OSS_KEY: string
- OSS_SECRET: string
- OSS_BUCKET: string
- OSS_REGION: string
- OSS_ENDPOINT: string
-
- // 文件上传配置
- UPLOAD_FOLDER: string
- // 支付配置
- PAYMENT_URL: string
- PAYMENT_KEY: string
- PAYMENT_PID: string
- // Redis配置(可选)
- REDIS_HOST?: string
- REDIS_PORT?: number
- REDIS_PASSWORD?: string
- REDIS_DB?: number
- // 视频API配置(可选)
- VIDEO_API_URL?: string
- }
- dataSource: DataSource
- redis?: Redis
- bannerStatisticsScheduler?: BannerStatisticsScheduler
- }
- interface FastifyRequest {
- file(): Promise<{
- filename: string
- mimetype: string
- toBuffer(): Promise<Buffer>
- } | null>
- user?: {
- id: number
- name: string
- role: string
- iat?: number
- }
- }
- }
|