| | |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | |
| | | static std::string loadLoginData(string account,string pwd) { |
| | | Json::Value root; |
| | | root["type"] = 20; |
| | | Json::Value data; |
| | | data["account"] = account; |
| | | data["pwd"] = pwd; |
| | | root["data"] = data; |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | |
| | | static std::string loadHeartbeatData(int client) { |
| | | Json::Value root; |
| | | root["type"] = 30; |
| | | Json::Value data; |
| | | data["client"] = client; |
| | | root["data"] = data; |
| | | return toJsonStr(root); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | static Json::Value parseJson(string data) { |
| | | Json::Value root; |
| | | Json::Reader reader; |
| | |
| | | return root; |
| | | } |
| | | |
| | | static string jsonValue2String(Json::Value value) { |
| | | Json::FastWriter fastWriter; |
| | | std::string output = fastWriter.write(value); |
| | | return output; |
| | | } |
| | | |
| | | |
| | | |
| | | |