NestJS 11 + Fastify 统一错误体与 trace_id,/health 真实探活 DB/Redis,OpenAPI 3.1 契约含 20 个错误码;shared 包提供错误码、权限点、ULID、分页与通用 schema;worker 完成队列进程骨架。
20 lines
485 B
TypeScript
20 lines
485 B
TypeScript
import { Global, Module } from '@nestjs/common';
|
|
|
|
import { APP_CONFIG } from '../../config/config.module';
|
|
import type { AppConfig } from '../../config/env';
|
|
import { PRISMA } from '../tokens';
|
|
import { PrismaService } from './prisma.service';
|
|
|
|
@Global()
|
|
@Module({
|
|
providers: [
|
|
{
|
|
provide: PRISMA,
|
|
inject: [APP_CONFIG],
|
|
useFactory: (config: AppConfig): PrismaService => new PrismaService(config),
|
|
},
|
|
],
|
|
exports: [PRISMA],
|
|
})
|
|
export class PrismaModule {}
|