admin
2023-01-02 954ead41d9391bca28a3cc4f9592f73f25b3bbc8
app/JsonUtil.h
@@ -72,18 +72,19 @@
   }
   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;
@@ -160,6 +161,7 @@
         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;
@@ -223,7 +225,7 @@
   }
   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;
@@ -238,6 +240,7 @@
         data[index++] = item;
      }
      root["data"] = data;
      root["add"] = add;
      return toJsonStr(root);
   }
@@ -292,6 +295,17 @@
      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;