Spaces:
Runtime error
Runtime error
Download src/api/repository/repository.service.ts from oex2003/evolution-api: direct link, hf CLI and curl.
- Browser
- Download file 676 Bytes
-
https://huggingface.co/spaces/oex2003/evolution-api/resolve/main/src/api/repository/repository.service.ts
- Command line
-
hf download hf://spaces/oex2003/evolution-api/src/api/repository/repository.service.ts
-
curl -L -o repository.service.ts https://huggingface.co/spaces/oex2003/evolution-api/resolve/main/src/api/repository/repository.service.ts
676 Bytes
| 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'); | |
| } | |
| } | |