迁移数据库到db服务

This commit is contained in:
qing committed 2026-07-26 01:10:21 +08:00
1 parent 847f5fe8ab
commit 96213d58bd
2 files changed
+218 -219

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
#pragma once
#include <us/HttpClient.hpp>
#include <boost/json.hpp>
namespace qing {
namespace json = boost::json;
class DbC {
public:
static json::value call_http(json::value& params) {
auto client = pmc::net::HttpClient();
client.set_header("Content-Type: application/json");
std::string payload = json::serialize(params);
std::string res = "";
client.post_stream_sync(_DBURL, payload, [&res](const auto& ret) {
res += ret;
});
return json::parse(res);
}
private:
static constexpr const char* _DBURL = "http://127.0.0.1:8005/execute";
};
}