| | |
| | | HttpWebRequest request = (System.Net.HttpWebRequest)WebRequest.Create(url); |
| | | request.Method = "POST"; |
| | | // 内容类型 |
| | | request.ContentType = "application/json;charset=utf-8"; |
| | | request.ContentType = "application/json"; |
| | | //request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.124 Safari/537.36 Edg/102.0.1245.44"; |
| | | //request.Headers.Add("hexin-v", "A7V-DydvPAbIKFi6ykYGWU5hxDt2MmlEM-ZNmDfacSx7Dteh_4J5FMM2XWnE"); |
| | | var payload = System.Text.Encoding.UTF8.GetBytes(content); |
| | | request.ContentLength = payload.Length; |
| | | Stream writer = request.GetRequestStream(); |
| | |
| | | string Result = SendRequest(GetSearchUrl, Content, Encoding.UTF8); |
| | | //JavaMsgData javaMsgData = JsonHelper.ToObject<JavaMsgData>(Result); |
| | | return (JObject)JsonConvert.DeserializeObject(Result); |
| | | |
| | | } |
| | | |
| | | //public object GetWenCaiAnswerList(string SearchInfo, int PageSize,int PageNo) |
| | | //{ |
| | | // string URL = "http://www.iwencai.com/unifiedwap/unified-wap/v2/result/get-robot-data"; |
| | | // WenCaiListPara wenCaiListPara = new WenCaiListPara(); |
| | | // wenCaiListPara.question = SearchInfo; |
| | | // wenCaiListPara.perpage = PageSize.ToString(); |
| | | // wenCaiListPara.page = PageNo.ToString(); |
| | | // string Content = JsonHelper.ToJson(wenCaiListPara); |
| | | // string GetSearchUrl = URL;//+"?question=连续5日成交额大于5亿且股东人数&perpage=1000&page=1&secondary_intent=&log_info={'input_type':'click'}&source=Ths_iwencai_Xuangu&version=2.0"; |
| | | // string Result = SendRequest(GetSearchUrl, Content, Encoding.UTF8); |
| | | // return (JObject)JsonConvert.DeserializeObject(Result); |
| | | //} |
| | | |
| | | //public object GetChinaStockList(string SearchInfo, int ReportType) |
| | | //{ |
| | |
| | | |
| | | public string page { get; set; } |
| | | |
| | | public string secondary_intent { get; set; } = ""; |
| | | public string secondary_intent { get; set; } = "stock"; |
| | | |
| | | public string log_info { get; set; } = "{ 'input_type':'click' }"; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //[HttpPost] |
| | | //public ActionResult GetWenCaiAnswerList(string SearchInfo, int PageSize, int PageNo) |
| | | //{ |
| | | // try |
| | | // { |
| | | // var list = _acc.GetWenCaiAnswerList(SearchInfo,PageSize,PageNo); |
| | | // return SuccessNoShow(data: list); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // LogHelper.Write(Level.Error, "获取问财问答列表 GetWenCaiAnswerList", e, |
| | | // "Guest");//OperatorProvider.Instance.Current.LoginName |
| | | // return Error(); |
| | | // } |
| | | //} |
| | | } |
| | | } |
| | |
| | | using System.Text.RegularExpressions; |
| | | using System.Threading.Tasks; |
| | | using System.Web.Mvc; |
| | | using CommonHelper; |
| | | using CommonHelper.Redis; |
| | | using Flurl.Http; |
| | | |
| | |
| | | [HttpPost] |
| | | public async Task<ActionResult> GetWenCaiAnswerList(string question, int pageSize, int pageNo) |
| | | { |
| | | var v = _customerRedis.Get("wencai_v"); |
| | | var v = _customerRedis.Get("wencai_v"); //"A1KZZpxeY5TyBp9oALdJcIVAoxItY1b9iGdKIRyrfoXwL_CIBPOmDVj3mjDv";// |
| | | var url = "https://www.iwencai.com/unifiedwap/unified-wap/v2/result/get-robot-data"; |
| | | var param = new |
| | | { |
| | | question=question, |
| | | perpage=pageSize, |
| | | page=pageNo, |
| | | source= "ths_mobile_iwencai", |
| | | source= "Ths_iwencai_Xuangu", |
| | | add_info="{\"urp\":{\"scene\":3,\"company\":1,\"business\":1,\"is_lowcode\":1},\"contentType\":\"json\"}" |
| | | }; |
| | | |
| | | var res = await url.WithHeader("hexin-v", v).PostUrlEncodedAsync(param).ReceiveString(); |
| | | string strCov = Regex.Unescape(res); |
| | | return SuccessNoShow(data: strCov); |
| | | //去除冗余字段 |
| | | string tmpInfoA="", strCovA=""; |
| | | int i = strCov.IndexOf("\"meta\""); |
| | | int j = strCov.IndexOf("\"puuid\""); |
| | | if (i > 0 && j > 0) |
| | | { |
| | | tmpInfoA = strCov.Substring(i - 1, j - i - 1); |
| | | strCovA = strCov.Replace(tmpInfoA, ""); |
| | | } |
| | | i = strCovA.IndexOf("\"layout_data\""); |
| | | j = strCovA.IndexOf("\"layout_mode\""); |
| | | if (i > 0 && j > 0) |
| | | { |
| | | tmpInfoA = strCovA.Substring(i, j - i); |
| | | strCovA = strCovA.Replace(tmpInfoA, ""); |
| | | } |
| | | //object m= JsonHelper.JSONToObject<object>(strCov); |
| | | return SuccessNoShow(data: strCovA); |
| | | } |
| | | } |
| | | } |