feat(server): add model base (#9734)

This commit is contained in:
forehalo
2025-01-17 02:03:53 +00:00
parent c2149f218b
commit 64335b9e0c
12 changed files with 105 additions and 65 deletions

View File

@@ -0,0 +1,19 @@
import { Inject, Logger } from '@nestjs/common';
import { PrismaClient } from '@prisma/client';
import { Config } from '../base';
import type { Models } from '.';
import { MODELS_SYMBOL } from './provider';
export class BaseModel {
protected readonly logger = new Logger(this.constructor.name);
@Inject(MODELS_SYMBOL)
protected readonly models!: Models;
@Inject(Config)
protected readonly config!: Config;
@Inject(PrismaClient)
protected readonly db!: PrismaClient;
}