From 8ea6d363df77de2dca288397da8d4f9c3d3a5c4d Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 18 十月 2024 18:41:57 +0800 Subject: [PATCH] '项目完善' --- DelegateQueue/MyNetworkApi.cpp | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/DelegateQueue/MyNetworkApi.cpp b/DelegateQueue/MyNetworkApi.cpp index f767059..4f85e60 100644 --- a/DelegateQueue/MyNetworkApi.cpp +++ b/DelegateQueue/MyNetworkApi.cpp @@ -16,7 +16,7 @@ const char* json_content = buf.GetString(); string result = base_trade_request(std::string(json_content)); //return result; - /*string result = "{\"code\": 0, \"data\": {\"account_available_money\": 142688.82, \"delegates\": [{\"id\": \"110010190002045\", \"code_info\": [\"603332\", \"\\u82cf\\u5dde\\u9f99\\u67701\"], \"total_num\": 21234, \"finish_num\": 9999, \"buy1_money\": \"2541.76\\u4e07\", \"big_num_count\": 3, \"big_num_money\": \"1475.14\\u4e07\", \"not_deal_big_num_count\": [1, 1], \"not_deal_big_num_money\": [\"984.9\\u4e07\", \"502.35\\u4e07\"], \"left_count\": 0, \"volume_rate\": 0.78, \"left_money\": \"693.34\\u4e07\", \"pay_attention\": true, \"trade_progress_percent\": 27.28, \"limit_up_price\": 9.85, \"is_near_big_order\": true, \"block\": \"\\u5316\\u5de5-1\", \"trade_queue\": [[7039, 2], [20, 1], [1754, 0], [1663, 0], [5100, 2]]},{\"id\": \"110010190002046\", \"code_info\": [\"001696\", \"\\u82cf\\u5dde\\u9f99\\u67702\"], \"total_num\": 21234, \"finish_num\": 9999, \"buy1_money\": \"2541.76\\u4e07\", \"big_num_count\": 3, \"big_num_money\": \"1475.14\\u4e07\", \"not_deal_big_num_count\": [1, 1], \"not_deal_big_num_money\": [\"984.9\\u4e07\", \"502.35\\u4e07\"], \"left_count\": 0, \"volume_rate\": 0.78, \"left_money\": \"693.34\\u4e07\", \"pay_attention\": true, \"trade_progress_percent\": 27.28, \"limit_up_price\": 9.85, \"is_near_big_order\": true, \"block\": \"\\u5316\\u5de5-1\", \"trade_queue\": [[7039, 2], [20, 1], [1754, 0], [1663, 0], [5100, 2]]},{\"id\": \"110010190002047\", \"code_info\": [\"600383\", \"\\u82cf\\u5dde\\u9f99\\u67703\"], \"total_num\": 21234, \"finish_num\": 9999, \"buy1_money\": \"2541.76\\u4e07\", \"big_num_count\": 3, \"big_num_money\": \"1475.14\\u4e07\", \"not_deal_big_num_count\": [1, 1], \"not_deal_big_num_money\": [\"984.9\\u4e07\", \"502.35\\u4e07\"], \"left_count\": 0, \"volume_rate\": 0.78, \"left_money\": \"693.34\\u4e07\", \"pay_attention\": true, \"trade_progress_percent\": 27.28, \"limit_up_price\": 9.85, \"is_near_big_order\": true, \"block\": \"\\u5316\\u5de5-1\", \"trade_queue\": [[7039, 2], [20, 1], [1754, 0], [1663, 0], [5100, 2]]}]}}";*/ + //string result = "{\"code\": 0, \"data\": {\"account_available_money\": 142688.82, \"delegates\": [{\"id\": \"110010190002045\", \"code_info\": [\"603332\", \"\\u82cf\\u5dde\\u9f99\\u67701\"], \"total_num\": 21234, \"finish_num\": 9999, \"buy1_money\": \"2541.76\\u4e07\", \"big_num_count\": 3, \"big_num_money\": \"1475.14\\u4e07\", \"not_deal_big_num_count\": [1, 1], \"not_deal_big_num_money\": [\"984.9\\u4e07\", \"502.35\\u4e07\"], \"left_count\": 0, \"volume_rate\": 0.78, \"left_money\": \"693.34\\u4e07\", \"pay_attention\": true, \"trade_progress_percent\": 27.28, \"limit_up_price\": 9.85, \"is_near_big_order\": true, \"block\": \"\\u5316\\u5de5-1\", \"trade_queue\": [[7039, 2], [20, 1], [1754, 0], [1663, 0], [5100, 2]]},{\"id\": \"110010190002046\", \"code_info\": [\"001696\", \"\\u82cf\\u5dde\\u9f99\\u67702\"], \"total_num\": 21234, \"finish_num\": 9999, \"buy1_money\": \"2541.76\\u4e07\", \"big_num_count\": 3, \"big_num_money\": \"1475.14\\u4e07\", \"not_deal_big_num_count\": [1, 1], \"not_deal_big_num_money\": [\"984.9\\u4e07\", \"502.35\\u4e07\"], \"left_count\": 0, \"volume_rate\": 0.78, \"left_money\": \"693.34\\u4e07\", \"pay_attention\": true, \"trade_progress_percent\": 27.28, \"limit_up_price\": 9.85, \"is_near_big_order\": true, \"block\": \"\\u5316\\u5de5-1\", \"trade_queue\": [[7039, 2], [20, 1], [1754, 0], [1663, 0], [5100, 2]]},{\"id\": \"110010190002047\", \"code_info\": [\"600383\", \"\\u82cf\\u5dde\\u9f99\\u67703\"], \"total_num\": 21234, \"finish_num\": 9999, \"buy1_money\": \"2541.76\\u4e07\", \"big_num_count\": 3, \"big_num_money\": \"1475.14\\u4e07\", \"not_deal_big_num_count\": [1, 1], \"not_deal_big_num_money\": [\"984.9\\u4e07\", \"502.35\\u4e07\"], \"left_count\": 0, \"volume_rate\": 0.78, \"left_money\": \"693.34\\u4e07\", \"pay_attention\": true, \"trade_progress_percent\": 27.28, \"limit_up_price\": 9.85, \"is_near_big_order\": true, \"block\": \"\\u5316\\u5de5-1\", \"trade_queue\": [[7039, 2], [20, 1], [1754, 0], [1663, 0], [5100, 2]]}]}}"; return result; } @@ -80,3 +80,23 @@ string result = base_trade_request(std::string(json_content)); return result; } + +string MyNetworkApi::add_black(string code) +{ + rapidjson::StringBuffer buf; + rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buf); + writer.StartObject(); + writer.Key("type"); + writer.Int(201); + writer.Key("data"); + writer.StartObject(); + writer.Key("codes"); + writer.StartArray(); + writer.String(code.c_str()); + writer.EndArray(); + writer.EndObject(); + writer.EndObject(); + const char* json_content = buf.GetString(); + string result = base_trade_request(std::string(json_content)); + return result; +} -- Gitblit v1.8.0