@ -1,6 +1,6 @@
|
||||
import APIKeyDao from './APIKey/APIKeyDao'
|
||||
import ConfigDao from './Config/ConfigDao'
|
||||
import Dao from './Dao'
|
||||
import SessionDao from './Session/SessionDao'
|
||||
import UserDao from './User/UserDao'
|
||||
|
||||
/**
|
||||
@ -18,6 +18,7 @@ interface DaoItem {
|
||||
config: ConfigDao
|
||||
user: UserDao
|
||||
apiKey: APIKeyDao
|
||||
session: SessionDao
|
||||
}
|
||||
|
||||
/**
|
||||
@ -54,11 +55,12 @@ export default class DaoFactory {
|
||||
* @param item the element to init
|
||||
* @returns a new initialized dao or undefined if no dao is linked
|
||||
*/
|
||||
private static initDao(item: keyof DaoItem): Dao<any> | undefined {
|
||||
private static initDao(item: keyof DaoItem): any | undefined {
|
||||
switch (item) {
|
||||
case 'config': return new ConfigDao()
|
||||
case 'user': return new UserDao()
|
||||
case 'apiKey': return new APIKeyDao()
|
||||
case 'session': return new SessionDao()
|
||||
default: return undefined
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user