You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
64 lines
1.3 KiB
#pragma once |
|
|
|
#include "autostore/ILogger.h" |
|
#include <memory> |
|
#include <string> |
|
#include <string_view> |
|
#include <thread> |
|
|
|
namespace nxl::autostore { |
|
|
|
namespace application { |
|
class IItemRepository; |
|
class ITimeProvider; |
|
class IOrderService; |
|
class IAuthService; |
|
} // namespace application |
|
|
|
namespace infrastructure { |
|
class HttpServer; |
|
class TaskScheduler; |
|
} // namespace infrastructure |
|
|
|
namespace webapi { |
|
class StoreController; |
|
class AuthController; |
|
} // namespace webapi |
|
|
|
namespace application { |
|
class AddItem; |
|
class LoginUser; |
|
} // namespace application |
|
|
|
class AutoStore |
|
{ |
|
public: |
|
struct Config |
|
{ |
|
std::string dataPath; |
|
std::string host{"0.0.0.0"}; |
|
uint16_t port{8080}; |
|
}; |
|
|
|
AutoStore(Config config, ILoggerPtr logger); |
|
~AutoStore(); |
|
|
|
bool initialize(); |
|
bool start(); |
|
void stop(); |
|
|
|
private: |
|
Config config; |
|
ILoggerPtr log; |
|
|
|
std::unique_ptr<infrastructure::HttpServer> httpServer; |
|
std::unique_ptr<infrastructure::TaskScheduler> taskScheduler; |
|
std::unique_ptr<webapi::StoreController> storeController; |
|
std::unique_ptr<webapi::AuthController> authController; |
|
std::unique_ptr<application::IItemRepository> itemRepository; |
|
std::unique_ptr<application::ITimeProvider> clock; |
|
std::unique_ptr<application::IOrderService> orderService; |
|
std::unique_ptr<application::IAuthService> authService; |
|
}; |
|
|
|
} // namespace nxl::autostore
|