4 changed files with 39 additions and 29 deletions
@ -1,19 +1,37 @@ |
|||
import {systemRepo, userRepo, scoreRepo} from './dbInit'; |
|||
import {initDB} from './dbInit'; |
|||
|
|||
export function getAllSystemValues() { |
|||
return systemRepo.getAllSystemValues(); |
|||
} |
|||
class DbAPI { |
|||
constructor(){ |
|||
this.systemRepo = null; |
|||
this.scoreRepo = null; |
|||
this.userRepo = null; |
|||
} |
|||
|
|||
getAllSystemValues() { |
|||
return systemRepo.getAllSystemValues(); |
|||
} |
|||
|
|||
createSystemValue(key, value) { |
|||
systemRepo.createSystemValue(key, value); |
|||
return true; |
|||
} |
|||
|
|||
export function createSystemValue(key, value) { |
|||
systemRepo.createSystemValue(key, value); |
|||
return true; |
|||
} |
|||
deleteSystemValue(key) { |
|||
systemRepo.deleteSystemValue(key); |
|||
return true; |
|||
} |
|||
|
|||
getSystemValue(key) { |
|||
return systemRepo.getSystemKeyValue(key); |
|||
} |
|||
|
|||
export function deleteSystemValue(key) { |
|||
systemRepo.deleteSystemValue(key); |
|||
return true; |
|||
async initDB() { |
|||
let repos = await initDB(); |
|||
this.systemRepo = repos.systemRepo; |
|||
this.scoreRepo = repos.scoreRepo; |
|||
this.userRepo = repos.userRepo; |
|||
} |
|||
} |
|||
|
|||
export function getSystemValue(key) { |
|||
return systemRepo.getSystemKeyValue(key); |
|||
} |
|||
const dbAPI = new DbAPI(); |
|||
export default dbAPI; |
Loading…
Reference in new issue