Skip to content

Commit bf34d4a

Browse files
committed
feat(database-service): Updated ServiceProvider to use new model imports and added GroupRuleService and WarningDatabaseService methods
1 parent 9a16898 commit bf34d4a

1 file changed

Lines changed: 16 additions & 6 deletions

File tree

src/service/database/ServiceProvider.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import { PoolClient } from 'pg';
22
import { Client } from '../../database/Client';
33
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';
68

79
export class ServiceProvider {
810
private static instance: ServiceProvider;
@@ -38,11 +40,19 @@ export class ServiceProvider {
3840
return await this._connectionPool.getClient();
3941
}
4042
async getGroupService() {
41-
const clint = await this.getPoolClint();
42-
return new GroupService(clint);
43+
const client = await this.getPoolClint();
44+
return new GroupService(client);
4345
}
4446
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)
4757
}
4858
}

0 commit comments

Comments
 (0)