mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-11-30 02:48:57 +08:00
nlohmann_json 使用 xmake 获取
This commit is contained in:
parent
96a33080a0
commit
eaa40ff727
File diff suppressed because it is too large
Load Diff
@ -11,8 +11,9 @@
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "HttpValidError.h"
|
||||
#include "../common/json.hpp"
|
||||
#include "../common/log.h"
|
||||
|
||||
using json = nlohmann::json; // 不保持插入排序
|
||||
|
@ -19,7 +19,7 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
LOG_INFO("start server ... You can press Ctrl-C stop");
|
||||
|
||||
HttpServer server("http://*", 520);
|
||||
HttpServer server("http://*", 9001);
|
||||
|
||||
LoginService login(HKU_SERVICE_API(login));
|
||||
login.bind(&server);
|
||||
|
@ -31,10 +31,10 @@ public:
|
||||
setResHeader("Content-Type", "application/json; charset=UTF-8");
|
||||
}
|
||||
|
||||
virtual void after_run() override {
|
||||
/*virtual void after_run() override {
|
||||
// 强制关闭连接,即仅有短连接
|
||||
nng_http_res_set_status(m_nng_res, NNG_HTTP_STATUS_OK);
|
||||
}
|
||||
}*/
|
||||
};
|
||||
|
||||
#define REST_HANDLE_IMP(cls) \
|
||||
|
@ -1,7 +1,7 @@
|
||||
target("hkuserver")
|
||||
set_kind("binary")
|
||||
|
||||
add_packages("fmt", "spdlog", "flatbuffers", "nng", "yyjson")
|
||||
add_packages("fmt", "spdlog", "flatbuffers", "nng", "nlohmann_json")
|
||||
add_deps("hikyuu")
|
||||
|
||||
add_includedirs("..")
|
||||
|
@ -40,6 +40,7 @@ add_requires("fmt", {system=false, configs = {header_only = true, vs_runtime = "
|
||||
add_requires("spdlog", {system=false, configs = {header_only = true, fmt_external=true, vs_runtime = "MD"}})
|
||||
add_requires("flatbuffers", {system=false, configs = {vs_runtime="MD"}})
|
||||
add_requires("nng", {system=false, configs = {vs_runtime="MD"}})
|
||||
add_requires("nlohmann_json", {system=false})
|
||||
|
||||
add_defines("SPDLOG_DISABLE_DEFAULT_LOGGER") -- 禁用 spdlog 默认 logger
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user