예제 #1
0
 def __init__(self, dao_library, context_dir, config):
     self.file_service = FileService(context_dir, config)
     self.audit_service = AuditService(dao_library.audit_dao)
     self.encryption_service = EncryptionService(self.file_service)
     self.user_service = UserService(dao_library.user_dao,
                                     dao_library.client_data_dao,
                                     self.encryption_service)
     self.models_registry = ModelsRegistry()
     self.predictors_registry = PredictorsRegistry()
     self.decision_service = DecisionService(self.audit_service,
                                             self.user_service,
                                             self.models_registry,
                                             self.predictors_registry)
예제 #2
0
 def get(self, id):
     return marshal(UserService.get(id=id), user_fields)
예제 #3
0
 def post(self):
     args = self.reqparse.parse_args()
     return UserService.add(data=args).serialize
예제 #4
0
 def get(self):
     users = UserService.getAll()
     return [user.serialize for user in users]
예제 #5
0
tasksRepository = TasksRepository(taskMongoDataSource)
crawlerRepository = CrawlerRepository(stockMongoDataSource, tasksRepository)
stockRepository = StockRepository(stockMongoDataSource, tasksRepository)
factorRepository = FactorRepository(factorMongoDataSource, factorDartMongoDataSource, factorFileDataSource)
repositories = {
    "crawlerRepository": crawlerRepository,
    "tasksRepository": tasksRepository,
    "stockRepository": stockRepository,
    "factorRepository": factorRepository
}

# SCHEDULER
taskScheduler = TaskScheduler(stockMongoDataSource.client)

# SERVICE
userService = UserService()
stockService = StockService(stockRepository, tasksRepository, crawlerRepository)
factorService = FactorService(manager, factorRepository, tasksRepository, crawlerRepository, None)
taskService = TaskService(manager, tasksRepository, taskScheduler, factorService, stockService, crawlerRepository)
factorService.taskService = taskService


taskSocketRouter = TaskSocketRouter(taskService, manager)
factorSocketRouter = FactorSocketRouter(factorService, manager)
stockSocketRouter = StockSocketRouter(stockService, manager)


locator.register(manager)
locator.register(tasksRepository)
locator.register(crawlerRepository)
locator.register(tasksRepository)