提交 51516144 authored 作者: blu's avatar blu

feature: online update

上级 8934c41c
......@@ -765,43 +765,6 @@ public:
res.set_content(ret.dump(), "text/json");
});
svr.Get("/release", [this](const Request& req, Response& res) {
json ret;
string msg;
ret["code"] = 0;
ret["msg"] = "ok";
try{
string bundleId = req.get_param_value("bId");
auto body = json::parse(req.body);
ret = this->getVersionBundle(bundleId);
}catch(exception &e) {
ret["code"] = -1;
msg = fmt::format("evcloudsvc Get /release Exception: {}", e.what());
spdlog::error(msg);
ret["msg"] = msg;
}
res.set_content(ret.dump(), "text/json");
});
svr.Post("/release", [this](const Request& req, Response& res) {
json ret;
string msg;
ret["code"] = 0;
ret["msg"] = "ok";
try{
auto body = json::parse(req.body);
ret = this->addVersionBundle(body);
}catch(exception &e) {
ret["code"] = -1;
msg = fmt::format("evcloudsvc Post /release Exception: {}", e.what());
spdlog::error(msg);
ret["msg"] = msg;
}
res.set_content(ret.dump(), "text/json");
});
svr.Get("/keys", [](const Request& req, Response& res) {
string fileName = req.get_param_value("filename");
auto v = LVDB::getKeys(fileName);
......@@ -859,6 +822,43 @@ public:
res.set_content(this->configMap.dump(), "text/json");
});
svr.Get("/release", [this](const Request& req, Response& res) {
json ret;
string msg;
ret["code"] = 0;
ret["msg"] = "ok";
try{
string bundleId = req.get_param_value("bId");
auto body = json::parse(req.body);
ret = this->getVersionBundle(bundleId);
}catch(exception &e) {
ret["code"] = -1;
msg = fmt::format("evcloudsvc Get /release Exception: {}", e.what());
spdlog::error(msg);
ret["msg"] = msg;
}
res.set_content(ret.dump(), "text/json");
});
svr.Post("/release", [this](const Request& req, Response& res) {
json ret;
string msg;
ret["code"] = 0;
ret["msg"] = "ok";
try{
auto body = json::parse(req.body);
ret = this->addVersionBundle(body);
}catch(exception &e) {
ret["code"] = -1;
msg = fmt::format("evcloudsvc Post /release Exception: {}", e.what());
spdlog::error(msg);
ret["msg"] = msg;
}
res.set_content(ret.dump(), "text/json");
});
svr.listen("0.0.0.0", stoi(httpPort));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论