mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
synced 2026-01-27 10:23:15 +00:00
Refactoring project layout
This commit is contained in:
@@ -51,14 +51,15 @@ namespace OpenWifi {
|
||||
return instance_;
|
||||
}
|
||||
|
||||
void Daemon::initialize(Poco::Util::Application &self) {
|
||||
MicroService::initialize(*this);
|
||||
void Daemon::initialize() {
|
||||
AssetDir_ = MicroService::instance().ConfigPath("openwifi.restapi.wwwassets");
|
||||
AccessPolicy_ = MicroService::instance().ConfigGetString("openwifi.document.policy.access", "/wwwassets/access_policy.html");
|
||||
PasswordPolicy_ = MicroService::instance().ConfigGetString("openwifi.document.policy.password", "/wwwassets/password_policy.html");
|
||||
|
||||
std::cout << AssetDir_ << " .. " << AccessPolicy_ << " .. " << PasswordPolicy_ << std::endl;
|
||||
}
|
||||
|
||||
void MicroServicePostInitialization() {
|
||||
Daemon()->initialize();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenWifi {
|
||||
const SubSystemVec & SubSystems) :
|
||||
MicroService( PropFile, RootEnv, ConfigEnv, AppName, BusTimer, SubSystems) {};
|
||||
|
||||
void initialize(Poco::Util::Application &self) override;
|
||||
void initialize();
|
||||
static Daemon *instance();
|
||||
inline const std::string & AssetDir() { return AssetDir_; }
|
||||
inline const std::string & GetPasswordPolicy() const { return PasswordPolicy_; }
|
||||
|
||||
@@ -2227,6 +2227,8 @@ namespace OpenWifi {
|
||||
|
||||
};
|
||||
|
||||
inline class RESTAPI_InternalServer* RESTAPI_InternalServer::instance_ = nullptr;
|
||||
|
||||
inline RESTAPI_InternalServer * RESTAPI_InternalServer() { return RESTAPI_InternalServer::instance(); };
|
||||
|
||||
class InternalRequestHandlerFactory : public Poco::Net::HTTPRequestHandlerFactory {
|
||||
@@ -2271,7 +2273,6 @@ namespace OpenWifi {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct MicroServiceMeta {
|
||||
uint64_t Id=0;
|
||||
std::string Type;
|
||||
@@ -2526,11 +2527,14 @@ namespace OpenWifi {
|
||||
MyHash_ = CreateHash(MyPublicEndPoint_);
|
||||
}
|
||||
|
||||
void MicroServicePostInitialization();
|
||||
|
||||
inline void MicroService::initialize(Poco::Util::Application &self) {
|
||||
// add the default services
|
||||
SubSystems_.push_back(KafkaManager());
|
||||
SubSystems_.push_back(ALBHealthCheckServer());
|
||||
SubSystems_.push_back(RESTAPI_server());
|
||||
SubSystems_.push_back(RESTAPI_InternalServer());
|
||||
|
||||
Poco::Net::initializeSSL();
|
||||
Poco::Net::HTTPStreamFactory::registerFactory();
|
||||
@@ -2566,6 +2570,8 @@ namespace OpenWifi {
|
||||
|
||||
Types::TopicNotifyFunction F = [this](std::string s1,std::string s2) { this->BusMessageReceived(s1,s2); };
|
||||
KafkaManager()->RegisterTopicWatcher(KafkaTopics::SERVICE_EVENTS, F);
|
||||
|
||||
MicroServicePostInitialization();
|
||||
}
|
||||
|
||||
inline void MicroService::uninitialize() {
|
||||
|
||||
Reference in New Issue
Block a user