evolution-api / src /api /repository /repository.service.ts
oex2003's picture
Deploy Evolution API to Hugging Face Space
5e518ea
import { ConfigService } from '@config/env.config';
import { Logger } from '@config/logger.config';
import { PrismaClient } from '@prisma/client';
export class Query<T> {
where?: T;
sort?: 'asc' | 'desc';
page?: number;
offset?: number;
}
export class PrismaRepository extends PrismaClient {
constructor(private readonly configService: ConfigService) {
super();
}
private readonly logger = new Logger('PrismaRepository');
public async onModuleInit() {
await this.$connect();
this.logger.info('Repository:Prisma - ON');
}
public async onModuleDestroy() {
await this.$disconnect();
this.logger.warn('Repository:Prisma - OFF');
}
}