mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-11-28 08:58:49 +02:00
refactoring object manager imports
This commit is contained in:
parent
77c01fa230
commit
d57b166cc8
@ -1,12 +1,8 @@
|
||||
///<reference path="../../typings/index.d.ts"/>
|
||||
|
||||
import {IUserManager} from "./IUserManager";
|
||||
import {IGalleryManager} from "./IGalleryManager";
|
||||
import {MongoGalleryManager} from "./mongoose/MongoGalleryManager";
|
||||
import {MongoUserManager} from "./mongoose/MongoUserManager";
|
||||
import {GalleryManager} from "./memory/GalleryManager";
|
||||
import {UserManager} from "./memory/UserManager";
|
||||
import {ISearchManager} from "./ISearchManager";
|
||||
import {MongoSearchManager} from "./mongoose/MongoSearchManager";
|
||||
import {SearchManager} from "./memory/SearchManager";
|
||||
|
||||
export class ObjectManagerRepository {
|
||||
|
||||
@ -16,12 +12,18 @@ export class ObjectManagerRepository {
|
||||
private static _instance:ObjectManagerRepository = null;
|
||||
|
||||
public static InitMongoManagers() {
|
||||
let MongoGalleryManager = require("./mongoose/MongoGalleryManager");
|
||||
let MongoUserManager = require("./mongoose/MongoUserManager");
|
||||
let MongoSearchManager = require("./mongoose/MongoSearchManager");
|
||||
ObjectManagerRepository.getInstance().setGalleryManager(new MongoGalleryManager());
|
||||
ObjectManagerRepository.getInstance().setUserManager(new MongoUserManager());
|
||||
ObjectManagerRepository.getInstance().setSearchManager(new MongoSearchManager());
|
||||
}
|
||||
|
||||
public static MemoryMongoManagers() {
|
||||
let GalleryManager = require("./memory/GalleryManager");
|
||||
let UserManager = require("./memory/UserManager");
|
||||
let SearchManager = require("./memory/SearchManager");
|
||||
ObjectManagerRepository.getInstance().setGalleryManager(new GalleryManager());
|
||||
ObjectManagerRepository.getInstance().setUserManager(new UserManager());
|
||||
ObjectManagerRepository.getInstance().setSearchManager(new SearchManager());
|
||||
|
Loading…
Reference in New Issue
Block a user