| | |
| | | #include "LimitUpCapture.h" |
| | | #include "TradeListCapture.h" |
| | | #include "IndustryCapture.h" |
| | | #include "CurrentPriceCapture.h" |
| | | #include "TaskChecker.h" |
| | | |
| | | class JsonUtil { |
| | | |
| | |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | static std::string loadGPPriceData(std::list<CurrentPriceData> dataList) { |
| | | Json::Value root; |
| | | root["type"] = 40; |
| | | Json::Value data; |
| | | |
| | | std::list<CurrentPriceData>::iterator ele; |
| | | int index = 0; |
| | | for (ele = dataList.begin();ele != dataList.end();ele++) { |
| | | Json::Value item; |
| | | item["code"] = (*ele).code; |
| | | item["price"] = (*ele).price; |
| | | data[index++] = item; |
| | | } |
| | | root["data"] = data; |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | |
| | | static std::string loadGPCodeData(std::list<IndustryData> codeList) { |
| | | Json::Value root; |
| | |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | static std::string loadHeartbeatData(int client,string memery) { |
| | | static std::string loadHeartbeatData(int client,string memery,string ownMemery) { |
| | | Json::Value root; |
| | | root["type"] = 30; |
| | | Json::Value data; |
| | | data["client"] = client; |
| | | data["memery"] = memery; |
| | | data["own_memery"] = ownMemery; |
| | | root["data"] = data; |
| | | return toJsonStr(root); |
| | | } |
| | |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | static std::string toJson(ClientEnvState state) { |
| | | Json::Value root; |
| | | root["ths_l2_win"] = state.ths_l2_win; |
| | | root["ths_fp_1"] = state.ths_fp_1; |
| | | root["ths_fp_2"] = state.ths_fp_2; |
| | | root["ths_trade_success"] = state.ths_trade_success; |
| | | root["l2_channel_valid_count"] = state.l2_channel_valid_count; |
| | | root["l2_channel_invalid_count"] = state.l2_channel_invalid_count; |
| | | root["limitUp"] = state.limitUp; |
| | | root["tradeSuccess"] = state.tradeSuccess; |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | |
| | | |
| | | |