public RES Get(string token, string method, string req) { var inst = AI_T.GetInst(); var res = inst.GetType().GetMethod(method).Invoke(inst, new object[] { req }); return(res as RES); }
public RES Post() { var method = this.Request.Form["method"]; var req = this.Request.Form["req"]; var inst = AI_T.GetInst(); var res = inst.GetType().GetMethod(method).Invoke(inst, new object[] { req.ToString() }); return(res as RES); }
protected void AutoSync() { while (true) { if (false) { #region 所有机构同步 try { var setName = $"Stock:JG"; var qSyncName = $"Stock:Sync:2DB:{setName}"; var keyName = $"Stock:Sync:2DB:Check:{setName}"; var res = REDIS.Current.CacheGet <string>(keyName); if (!res.SUCCESS) { this.步所有机构(); REDIS.Current.CacheSet(keyName, DateTime.Now.ToString(), new TimeSpan(24, 0, 0)); } } catch (Exception ex) { Console.WriteLine($"执行所有机构同步任务出现异常 {ex.Message}"); } #endregion } this.ExecuteIncSyncTask <ShortNews>("增量同步东方网快讯", "Stock:Sync:2DB:Stock:ShortNews", (w) => { var resWords = AI_T.GetInst().KeywordsExtraction(w.Content); if (resWords.SUCCESS && resWords.DATA is List <Keyword> ) { var words = resWords.DATA as List <Keyword>; var setName = "Stock:Keywords:ALL"; var qSyncName = $"Stock:Sync:2DB:{setName}"; words.ForEach(m => { REDIS.Current.Enqueue(qSyncName, new Keywords { Id = GUID.FromStringToGuid(m.Word), Keyword = m.Word }); var res = REDIS.Current.SetAdd(setName, m.Word); }); } return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <北向持股统计>("增量同步北向持股统计", "Stock:Sync:2DB:Stock:BXCGTJ", (w) => { return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <北向机构持股明细>("增量同步北向机构持股明细", "Stock:Sync:2DB:Stock:BXCGMXURL", (w) => { return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <融资融券>($"增量同步{nameof(融资融券)}", "Stock:Sync:2DB:Stock:RZRQ:*", (w) => { return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <资金流向>($"增量同步{nameof(资金流向)}", "Stock:Sync:2DB:Stock:ZJLX:*", (w) => { return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <财务主要指标>("增量同步财务分析", "Stock:Sync:2DB:Stock:CWFX:*", (w) => { return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <北向成交明细>("增量同步北向成交明细", "Stock:Sync:2DB:Stock:BXCJMX", (w) => { return(new object[] { w.Code, w.日期tag }); }); this.ExecuteIncSyncTask <Keywords>("增量同步关键词", "Stock:Sync:2DB:Stock:Keywords:ALL", (w) => { return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <北向代码>($"增量同步{nameof(北向代码)}", "Stock:Sync:2DB:Stock:BXCode", (w) => { return(new object[] { w.Code }); }); this.ExecuteIncSyncTask <StockCode>($"增量同步{nameof(StockCode)}", "Stock:Sync:2DB:Stock:ALLCode", (w) => { return(new object[] { w.Code }); }); this.ExecuteIncSyncTask <Conception>($"增量同步{nameof(Conception)}", "Stock:Sync:2DB:Stock:ALLConception", (w) => { return(new object[] { w.Name }); }); this.ExecuteIncSyncTask <Article>($"增量同步{nameof(Article)}", "Stock:Sync:2DB:Stock:Article", (w) => { var resWords = AI_T.GetInst().KeywordsExtraction(w.Content); if (resWords.SUCCESS && resWords.DATA is List <Keyword> ) { var words = resWords.DATA as List <Keyword>; var setName = "Stock:Keywords:ALL"; var qSyncName = $"Stock:Sync:2DB:{setName}"; words.ForEach(m => { REDIS.Current.Enqueue(qSyncName, new Keywords { Id = GUID.FromStringToGuid(m.Word), Keyword = m.Word }); var res = REDIS.Current.SetAdd(setName, m.Word); }); } return(new object[] { w.Id }); }); this.ExecuteIncSyncTask <Jgdylb>($"增量同步{nameof(Jgdylb)}", "Stock:Sync:2DB:Stock:JGDYLB", (w) => { return(new object[] { w.Id }); }); Console.WriteLine($"同步任务检查 {DateTime.Now}"); Thread.Sleep(5000); } }