feat: prisma and remove mongodb

This commit is contained in:
Davidson Gomes
2024-06-06 14:47:58 -03:00
parent 35f97e08dd
commit 36ec67cef9
76 changed files with 1663 additions and 3894 deletions
+4 -3
View File
@@ -1,7 +1,8 @@
import { Proxy } from '@prisma/client';
import { Logger } from '../../config/logger.config';
import { InstanceDto } from '../dto/instance.dto';
import { ProxyDto } from '../dto/proxy.dto';
import { ProxyRaw } from '../models';
import { WAMonitoringService } from './monitor.service';
export class ProxyService {
@@ -16,7 +17,7 @@ export class ProxyService {
return { proxy: { ...instance, proxy: data } };
}
public async find(instance: InstanceDto): Promise<ProxyRaw> {
public async find(instance: InstanceDto): Promise<Proxy> {
try {
this.logger.verbose('find proxy: ' + instance.instanceName);
const result = await this.waMonitor.waInstances[instance.instanceName].findProxy();
@@ -27,7 +28,7 @@ export class ProxyService {
return result;
} catch (error) {
return { enabled: false, proxy: null };
return null;
}
}
}