|
1 | 1 | import { PoolClient } from 'pg'; |
2 | 2 | import { Client } from '../../database/Client'; |
3 | 3 | import { ConnectionPool } from '../../database/ConnectionPool'; |
4 | | -import { GroupService } from '../../database/service/group/Group'; |
5 | | -import { UserService } from '../../database/service/user/User'; |
| 4 | +import { GroupService } from '../../database/models/Group'; |
| 5 | +import { UserService } from '../../database/models/User'; |
| 6 | +import { GroupRuleService } from '../../database/models/GroupRule'; |
| 7 | +import { WarningDatabaseService } from '../../database/models/Warning'; |
6 | 8 |
|
7 | 9 | export class ServiceProvider { |
8 | 10 | private static instance: ServiceProvider; |
@@ -38,11 +40,19 @@ export class ServiceProvider { |
38 | 40 | return await this._connectionPool.getClient(); |
39 | 41 | } |
40 | 42 | async getGroupService() { |
41 | | - const clint = await this.getPoolClint(); |
42 | | - return new GroupService(clint); |
| 43 | + const client = await this.getPoolClint(); |
| 44 | + return new GroupService(client); |
43 | 45 | } |
44 | 46 | async getUserService() { |
45 | | - const clint = await this.getPoolClint(); |
46 | | - return new UserService(clint); |
| 47 | + const client = await this.getPoolClint(); |
| 48 | + return new UserService(client); |
| 49 | + } |
| 50 | + async getRulesService(){ |
| 51 | + const client = await this.getPoolClint() |
| 52 | + return new GroupRuleService(client) |
| 53 | + } |
| 54 | + async getWarnsService(){ |
| 55 | + const clint = await this.getPoolClint() |
| 56 | + return new WarningDatabaseService(clint) |
47 | 57 | } |
48 | 58 | } |
0 commit comments