正在显示
11 个修改的文件
包含
18 行增加
和
23 行删除
| ... | ... | @@ -23,7 +23,7 @@ bool DmpServer::accept(const std::string &url) |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | //子类实现 |
| 26 | -bool DmpServer::publish(const std::string &name, unsigned int capability, const DmpProject &project) | |
| 26 | +bool DmpServer::publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) | |
| 27 | 27 | { |
| 28 | 28 | return false; |
| 29 | 29 | } | ... | ... |
| ... | ... | @@ -28,7 +28,7 @@ public: |
| 28 | 28 | virtual bool accept(const std::string &url); |
| 29 | 29 | virtual void executeRequest(DmpServerRequest &request, DmpServerResponse &response) = 0; |
| 30 | 30 | |
| 31 | - virtual bool publish(const std::string &serviceName, unsigned int capability, const DmpProject &project); | |
| 31 | + virtual bool publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project); | |
| 32 | 32 | virtual bool remove(const std::string &serviceName); |
| 33 | 33 | virtual bool start(const std::string &serviceName); |
| 34 | 34 | virtual bool stop(const std::string &serviceName); | ... | ... |
| ... | ... | @@ -99,7 +99,7 @@ bool DmpServerManager::removeProject(const std::string &serviceName) |
| 99 | 99 | return true; |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | -bool DmpServerManager::publish(const std::string &serverName, const std::string &serviceName, int capabilities, const std::string &projectData) | |
| 102 | +bool DmpServerManager::publish(const std::string& serverName, const std::string& serviceName, const std::string& title, int capabilities, const std::string& projectData) | |
| 103 | 103 | { |
| 104 | 104 | //project |
| 105 | 105 | std::string projData; |
| ... | ... | @@ -114,7 +114,7 @@ bool DmpServerManager::publish(const std::string &serverName, const std::string |
| 114 | 114 | return false; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if (!serverRegistry_->getServer(serverName)->publish(serviceName, capabilities, *project)) | |
| 117 | + if (!serverRegistry_->getServer(serverName)->publish(serviceName, title, capabilities, *project)) | |
| 118 | 118 | { |
| 119 | 119 | delete project; |
| 120 | 120 | return false; |
| ... | ... | @@ -122,6 +122,7 @@ bool DmpServerManager::publish(const std::string &serverName, const std::string |
| 122 | 122 | projects_[serviceName] = project; |
| 123 | 123 | return true; |
| 124 | 124 | } |
| 125 | + | |
| 125 | 126 | bool DmpServerManager::deleteService(const std::string &serverName, const std::string &serviceName) |
| 126 | 127 | { |
| 127 | 128 | if (serverRegistry_->getServer(serverName)->remove(serviceName) && removeProject(serviceName)) |
| ... | ... | @@ -176,7 +177,7 @@ bool DmpServerManager::LoadServices() |
| 176 | 177 | std::string type = e.second.get<std::string>("type"); |
| 177 | 178 | int capabilities =e.second.get<int>("capabilities"); |
| 178 | 179 | std::string project = e.second.get<std::string>("project"); |
| 179 | - this->publish(type,name,capabilities,project); | |
| 180 | + this->publish(type,name,title,capabilities,project); | |
| 180 | 181 | } |
| 181 | 182 | } |
| 182 | 183 | return true; | ... | ... |
| ... | ... | @@ -30,7 +30,7 @@ public: |
| 30 | 30 | std::shared_ptr<DmpServer> serverForRequest(const DmpServerRequest& request); |
| 31 | 31 | std::shared_ptr<DmpServerApi> apiForRequest(const DmpServerRequest& request); |
| 32 | 32 | |
| 33 | - bool publish(const std::string& serverName, const std::string& serviceName, int capabilities, const std::string& projectData); | |
| 33 | + bool publish(const std::string& serverName, const std::string& serviceName, const std::string& title, int capabilities, const std::string& projectData); | |
| 34 | 34 | bool deleteService(const std::string& serverName, const std::string& serviceName); |
| 35 | 35 | bool startService(const std::string& serverName, const std::string& serviceName); |
| 36 | 36 | bool stopService(const std::string& serverName, const std::string& serviceName); | ... | ... |
| ... | ... | @@ -9,10 +9,9 @@ |
| 9 | 9 | #include "dmpserverproject.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | -DmpServerProject::DmpServerProject(const std::string &name, const std::string &title, const std::string &description,const DmpProject *project): | |
| 12 | +DmpServerProject::DmpServerProject(const std::string &name, const std::string &title, const DmpProject *project): | |
| 13 | 13 | name_(name), |
| 14 | 14 | title_(title), |
| 15 | - description_(description), | |
| 16 | 15 | project_(project) |
| 17 | 16 | { |
| 18 | 17 | status_ = 1; | ... | ... |
| ... | ... | @@ -18,21 +18,16 @@ |
| 18 | 18 | class SERVER_EXPORT DmpServerProject |
| 19 | 19 | { |
| 20 | 20 | public: |
| 21 | - DmpServerProject(const std::string &name, | |
| 22 | - const std::string &title, | |
| 23 | - const std::string &description, | |
| 24 | - const DmpProject *project); | |
| 21 | + DmpServerProject(const std::string &name, const std::string &title, const DmpProject *project); | |
| 25 | 22 | std::string createTime() { return time_;} |
| 26 | 23 | const DmpProject* project() const { return project_;} |
| 27 | 24 | std::string name() const { return name_;} |
| 28 | 25 | std::string title() const { return title_;} |
| 29 | - std::string description() const { return description_;} | |
| 30 | 26 | int status() { return status_;} |
| 31 | 27 | void setStatus(int status) { status_ = status;} |
| 32 | 28 | private: |
| 33 | 29 | std::string name_; |
| 34 | 30 | std::string title_; |
| 35 | - std::string description_; | |
| 36 | 31 | std::string time_; |
| 37 | 32 | int status_; |
| 38 | 33 | int flag_; | ... | ... |
| ... | ... | @@ -125,7 +125,7 @@ void DmpManagerApiHandler::regService(const DmpServerApiContext &context) const |
| 125 | 125 | context.response()->write("{\"status\":\"false\",\"message\":\"服务发布失败\"}"); |
| 126 | 126 | return; |
| 127 | 127 | } |
| 128 | - if(context.manager()->publish(serverType, name, capabilities, project)) { | |
| 128 | + if(context.manager()->publish(serverType, name, title, capabilities, project)) { | |
| 129 | 129 | LOGGER_INFO("服务发布成功"); |
| 130 | 130 | context.response()->write("{\"status\":\"true\",\"message\":\"Pulish service successful!\"}"); |
| 131 | 131 | // std::string projData; | ... | ... |
| ... | ... | @@ -91,7 +91,7 @@ void DmpMapServer::executeRequest(DmpServerRequest &request, DmpServerResponse & |
| 91 | 91 | } |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | -bool DmpMapServer::publish(const std::string &name, unsigned int capability, const DmpProject &project) | |
| 94 | +bool DmpMapServer::publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) | |
| 95 | 95 | { |
| 96 | 96 | if(capability & DmpServiceType::WMTS) { |
| 97 | 97 | DmpService* wmtsservice = getService("WMTSService"); |
| ... | ... | @@ -105,8 +105,8 @@ bool DmpMapServer::publish(const std::string &name, unsigned int capability, con |
| 105 | 105 | return false; |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | - DmpServerProject* serverProject = new DmpServerProject(name,"","", &project); | |
| 109 | - serverProjects_[name] = serverProject; | |
| 108 | + DmpServerProject* serverProject = new DmpServerProject(serviceName, title, &project); | |
| 109 | + serverProjects_[serviceName] = serverProject; | |
| 110 | 110 | |
| 111 | 111 | return true; |
| 112 | 112 | } | ... | ... |
| ... | ... | @@ -37,7 +37,7 @@ public: |
| 37 | 37 | std::string path() const override { return std::string("^/DMap/Services/?([\\w./]*)/MapServer/([\\w]+)"); } |
| 38 | 38 | std::string capability() const override; |
| 39 | 39 | void executeRequest(DmpServerRequest &request, DmpServerResponse &response) override; |
| 40 | - bool publish(const std::string &serviceName, unsigned int capability, const DmpProject &project) override; | |
| 40 | + bool publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) override; | |
| 41 | 41 | bool remove(const std::string &serviceName) override; |
| 42 | 42 | bool start(const std::string &serviceName) override; |
| 43 | 43 | bool stop(const std::string &serviceName) override; | ... | ... |
| ... | ... | @@ -98,7 +98,7 @@ void DmpTileServer::executeRequest(DmpServerRequest &request, DmpServerResponse |
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | -bool DmpTileServer::publish(const std::string &name, unsigned int capability, const DmpProject &project) | |
| 101 | +bool DmpTileServer::publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) | |
| 102 | 102 | { |
| 103 | 103 | if(capability & DmpServiceType::WMTS) { |
| 104 | 104 | DmpService* wmtsservice = getService("WMTSService"); |
| ... | ... | @@ -112,8 +112,8 @@ bool DmpTileServer::publish(const std::string &name, unsigned int capability, co |
| 112 | 112 | return false; |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | - DmpServerProject* serverProject = new DmpServerProject(name,"","", &project); | |
| 116 | - serverProjects_[name] = serverProject; | |
| 115 | + DmpServerProject* serverProject = new DmpServerProject(serviceName, title, &project); | |
| 116 | + serverProjects_[serviceName] = serverProject; | |
| 117 | 117 | |
| 118 | 118 | return true; |
| 119 | 119 | } | ... | ... |
| ... | ... | @@ -37,7 +37,7 @@ public: |
| 37 | 37 | std::string path() const override { return std::string("^/DMap/Services/?([\\w./]*)/TileServer/([\\w.]+)([\\w./]*)"); } |
| 38 | 38 | std::string capability() const override; |
| 39 | 39 | void executeRequest(DmpServerRequest &request, DmpServerResponse &response) override; |
| 40 | - bool publish(const std::string &serviceName, unsigned int capability, const DmpProject &project) override; | |
| 40 | + bool publish(const std::string &serviceName, const std::string &title, unsigned int capability, const DmpProject &project) override; | |
| 41 | 41 | bool remove(const std::string &serviceName) override; |
| 42 | 42 | bool start(const std::string &serviceName) override; |
| 43 | 43 | bool stop(const std::string &serviceName) override; | ... | ... |
请
注册
或
登录
后发表评论