admin
2023-12-13 471f85bc683af5e612b216b60301e217a704d8e5
nlp接口打通获取财务数据20231212FX
5个文件已修改
59 ■■■■ 已修改文件
.vs/RiskControlRR/v15/Server/sqlite3/storage.ide 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.BLL/ChinaStockBLL.cs 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend.DAL/WenCaiListPara.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/ChinaStockController.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
GasolineBlend/Controllers/WenCaiController.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.vs/RiskControlRR/v15/Server/sqlite3/storage.ide
Binary files differ
GasolineBlend.BLL/ChinaStockBLL.cs
@@ -45,7 +45,9 @@
                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();
@@ -87,20 +89,9 @@
            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)
        //{
GasolineBlend.DAL/WenCaiListPara.cs
@@ -15,7 +15,7 @@
        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' }";
GasolineBlend/Controllers/ChinaStockController.cs
@@ -62,20 +62,5 @@
            }
        }
        //[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();
        //    }
        //}
    }
}
GasolineBlend/Controllers/WenCaiController.cs
@@ -1,6 +1,7 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Web.Mvc;
using CommonHelper;
using CommonHelper.Redis;
using Flurl.Http;
@@ -17,19 +18,37 @@
        [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);
        }
    }
}