| | |
| | | } |
| | | |
| | | |
| | | static std::string loadTradeQueueData(int clientID, int channel, string code, std::list<int> numList) { |
| | | static std::string loadTradeQueueData(int clientID, int channel, string code, L2TradeQueue tradeQueue) { |
| | | Json::Value data; |
| | | data["channel"] = channel; |
| | | data["code"] = code; |
| | | |
| | | Json::Value _data; |
| | | |
| | | std::list<int>::iterator ele; |
| | | int index = 0; |
| | | for (ele = numList.begin();ele != numList.end();ele++) { |
| | | _data[index++] = *ele; |
| | | } |
| | | _data["buyOnePrice"] = tradeQueue.buyOnePrice; |
| | | _data["buyOneVolumn"] = tradeQueue.buyOneVolumn; |
| | | _data["buyTime"] = tradeQueue.buyTime; |
| | | _data["sellOnePrice"] = tradeQueue.sellOnePrice; |
| | | _data["sellOneVolumn"] = tradeQueue.sellOneVolumn; |
| | | _data["sellTime"] = tradeQueue.sellTime; |
| | | |
| | | data["data"] = _data; |
| | | Json::Value root; |
| | | root["type"] = 10; |
| | |
| | | Json::Value item; |
| | | item["code"] = (*ele).code; |
| | | item["time"] = (*ele).time; |
| | | item["apply_time"] = (*ele).apply_time; |
| | | item["num"] = (*ele).num; |
| | | item["type"] = (*ele).type; |
| | | item["price"] = (*ele).price; |
| | |
| | | } |
| | | |
| | | |
| | | static std::string loadGPCodeData(std::list<IndustryData> codeList) { |
| | | static std::string loadGPCodeData(std::list<IndustryData> codeList,bool add) { |
| | | Json::Value root; |
| | | root["type"] = 1; |
| | | Json::Value data; |
| | |
| | | data[index++] = item; |
| | | } |
| | | root["data"] = data; |
| | | root["add"] = add; |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | |
| | | // 自动启动L2成功 |
| | | static std::string loadAutoStartL2(int client) { |
| | | Json::Value root; |
| | | root["type"] = 60; |
| | | Json::Value data; |
| | | data["client"] = client; |
| | | root["data"] = data; |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | static std::string toJson(ClientEnvState state) { |
| | | Json::Value root; |
| | | root["ths_l2_win"] = state.ths_l2_win; |