| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153 |
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc.Controllers;
- using Microsoft.AspNetCore.Mvc.Filters;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using dodohold.core;
- using static dodohold.core.ZTOExpress.CreateOrderArgs;
- using System.Net;
- using System.Security.Cryptography;
- using Spire.Pdf.Exporting.XPS.Schema;
- using System.Xml.Linq;
- using static QRCoder.PayloadGenerator;
- using TencentCloud.Ssl.V20191205.Models;
- using CSRedis;
- using System.Data;
- using TencentCloud.Omics.V20221128.Models;
- using TencentCloud.Csip.V20221121.Models;
- namespace molilian.core
- {
- public class TkLogCore
- {
- static string queue_tb_key = "queue:logs:tb";
- static string queue_jd_key = "queue:logs:jd";
- static string queue_parse_tb_key = "queue:parse_logs:tb";
- static string queue_parse_jd_key = "queue:parse_logs:jd";
- static string queue_parse_dy_key = "queue:parse_logs:dy";
- static string queue_parse_tool_key = "queue:parse_logs:tool";
- static string queue_coupon_key = "queue:coupon_logs";
- static string promotion_img_key = "queue:promotion:img";
- static string queue_cps_key = "queue:cps_logs";
- public static bool save_dailys_log = false;
- static TkLogCore()
- {
- int flag = RedisHelper.Get<int>("turn:save_dailys_log");
- if (flag == 1) save_dailys_log = true;
- }
- public static int BatchInsertLogDB(int limit)
- {
- var result = EndPointCore.ProcessEndPointNodes<int>(node =>
- {
- if (!node.is_public_api) return 0;
- if (CenterHub.IsCenter)
- {
- if (node.is_coupon_api) return 0;
- }
- else
- {
- if (!node.is_coupon_api) return 0;
- }
- if (string.IsNullOrEmpty(node.redis_server)) return 0;
- var redis = RedisClientManager.GetRedisClient(node.redis_server);
- return BatchInsertLogDB(limit, redis);
- });
- return result.Sum();
- }
- private static int save_tk_log(TkDataDTO data, string tablename, IDbConnection connection, IDbTransaction transaction)
- {
- return new DBContext.Table(connection, tablename)
- .Add("end_point", data.end_point)
- .Add("channel", (int)data.channel)
- .Add("accountId", data.accountId)
- .Add("accountName", data.accountName)
- .Add("rawContent", data.rawContent)
- .Add("rawContent2", data.rawContent2)
- .Add("success", data.success)
- .Add("message", data.message)
- .Add("reason", data.reason)
- .Add("content", data.content)
- .Add("couponAmount", data.couponAmount)
- .Add("itemId", data.itemId)
- .Add("itemName", data.itemName)
- .Add("pic", data.pic)
- .Add("promotionPrice", data.promotionPrice)
- .Add("taoToken", data.taoToken)
- .Add("shortLinkurl", data.shortLinkurl)
- .Add("deeplink_url", data.deeplink_url)
- .Add("num_iid", data.num_iid)
- .Add("elapsedTime", data.elapsedTime)
- .Add("subCode", data.subCode)
- .Add("ip", data.ip)
- .Add("oaid", data.oaid)
- .Add("create_time", data.create_time)
- .Create(DBContext.InsertType.NORMAL, transaction);
- }
- private static int save_tk_parse_logs(TkDataDTO data, string tablename, IDbConnection connection, IDbTransaction transaction)
- {
- return new DBContext.Table(connection, tablename)
- .Add("end_point", data.end_point)
- .Add("channel", (int)data.channel)
- .Add("linkType", (int)data.link_type)
- .Add("accountId", data.accountId)
- .Add("accountName", data.accountName)
- .Add("rawContent", data.rawContent)
- .Add("success", data.success)
- .Add("message", data.message)
- .Add("reason", data.reason)
- .Add("content", data.content)
- .Add("itemId", data.itemId)
- .Add("itemName", data.itemName)
- .Add("pic", data.pic)
- .Add("couponAmount", data.couponAmount)
- .Add("promotionPrice", data.promotionPrice)
- .Add("taoToken", data.taoToken)
- .Add("shortLinkurl", data.shortLinkurl)
- .Add("deeplink_url", data.deeplink_url)
- .Add("num_iid", data.num_iid)
- .Add("elapsedTime", data.elapsedTime)
- .Add("elapsedTime2", data.elapsedTime2)
- .Add("elapsedTime3", data.elapsedTime3)
- .Add("subCode", data.subCode)
- .Add("ip", data.ip)
- .Add("oaid", data.oaid)
- .Add("create_time", data.create_time)
- .Create(DBContext.InsertType.NORMAL, transaction);
- }
- private static int save_jd_parse_logs(JdDataDTO data, string tablename, IDbConnection connection, IDbTransaction transaction)
- {
- return new DBContext.Table(connection, tablename)
- .Add("end_point", data.end_point)
- .Add("channel", (int)data.channel)
- .Add("accountId", data.accountId)
- .Add("accountName", data.accountName)
- .Add("rawContent", data.rawContent)
- .Add("success", data.success)
- .Add("message", data.message)
- .Add("reason", data.reason)
- .Add("content", data.content)
- .Add("itemId", data.itemId)
- .Add("itemName", data.itemName)
- .Add("pic", data.pic)
- .Add("couponAmount", data.couponAmount)
- .Add("promotionPrice", data.promotionPrice)
- .Add("taoToken", data.taoToken)
- .Add("shortLinkurl", data.shortLinkurl)
- .Add("deeplink_url", data.deeplink_url)
- .Add("elapsedTime", data.elapsedTime)
- .Add("subCode", data.subCode)
- .Add("ip", data.ip)
- .Add("oaid", data.oaid)
- .Add("create_time", data.create_time)
- .Create(DBContext.InsertType.NORMAL, transaction);
- }
- public static int BatchInsertLogDB(int limit, CSRedisClient redis)
- {
- int total = 0;
- using var connection = DBContext.GetOpenConnection();
- connection.Open();
- using var transaction = connection.BeginTransaction();
- string cacheKey = ":lock_key:start_comparison_tk";
- bool start_comparison_tk = RedisHelper.Get<int>(cacheKey) > 0;
- try
- {
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<TkDataDTO>(queue_tb_key);
- if (data == null) break;
- if ("3JDaxNfPy83okP3kLScwCkGiuMcyC4PcyntF424979CC9C51BCAD0C245B1C7BA2".Equals(data.oaid) ||
- data.ip.Contains("127.0.0"))
- {
- save_tk_log(data, "tk_logs_test", connection, transaction);
- }
- else
- {
- data.id = save_tk_log(data, "tk_logs", connection, transaction);
- if (data.elapsedTime > 1000)
- {
- save_tk_log(data, "tk_logs_test", connection, transaction);
- }
- if (data.success)
- {
- save_tk_log(data, "tk_success_logs", connection, transaction);
- }
- if (!string.IsNullOrEmpty(data.itemId)) TkOrderTrackingCore.SaveLinkSummary(data);
- }
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<JdDataDTO>(queue_jd_key);
- if (data == null) break;
- new DBContext.Table(connection, "tk_logs")
- .Add("end_point", data.end_point)
- .Add("channel", (int)data.channel)
- .Add("accountId", data.accountId)
- .Add("accountName", data.accountName)
- .Add("rawContent", data.rawContent)
- .Add("rawContent2", data.rawContent2)
- .Add("success", data.success)
- .Add("message", data.message)
- .Add("reason", data.reason)
- .Add("shortLinkurl", data.shortLinkurl)
- .Add("deeplink_url", data.deeplink_url)
- .Add("elapsedTime", data.elapsedTime)
- .Add("ip", data.ip)
- .Add("oaid", data.oaid)
- .Add("create_time", data.create_time)
- .Create(DBContext.InsertType.NORMAL, transaction);
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<TkDataDTO>(queue_parse_tb_key);
- if (data == null) break;
- if ("3JDaxNfPy83okP3kLScwCkGiuMcyC4PcyntF424979CC9C51BCAD0C245B1C7BA2".Equals(data.oaid) ||
- data.ip.Contains("127.0.0"))
- {
- save_tk_parse_logs(data, "tk_parse_logs_test", connection, transaction);
- }
- else
- {
- data.id = save_tk_parse_logs(data, "tk_parse_logs", connection, transaction);
- //每日分表
- if (save_dailys_log)
- {
- string daily_table = $"tk_parse_logs_{DateTime.Now:yyyyMMdd}";
- save_tk_parse_logs(data, daily_table, connection, transaction);
- }
- if (data.elapsedTime > 1000)
- {
- save_tk_parse_logs(data, "tk_parse_logs_test", connection, transaction);
- }
- if (data.success)
- {
- save_tk_parse_logs(data, "tk_success_parse_logs", connection, transaction);
- }
- if (!string.IsNullOrEmpty(data.itemId)) TkOrderTrackingCore.SaveLinkSummary(data);
- }
- if (data.reason.Contains("初步筛选2") && !data.rawContent.Contains("I:/kWqN5t623Hx"))
- {
- save_tk_parse_logs(data, "tk_parse_logs_test2", connection, transaction);
- }
- if (data.reason.Contains("初步筛选1.5"))
- {
- save_tk_parse_logs(data, "tk_parse_logs_multi_token", connection, transaction);
- }
- if (data.reason.Contains("霸下验证码"))
- {
- save_tk_parse_logs(data, "tk_parse_logs_captcha", connection, transaction);
- }
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<JdDataDTO>(queue_parse_jd_key);
- if (data == null) break;
- if ("3JDaxNfPy83okP3kLScwCkGiuMcyC4PcyntF424979CC9C51BCAD0C245B1C7BA2".Equals(data.oaid) ||
- data.ip.Contains("127.0.0"))
- {
- save_jd_parse_logs(data, "jd_parse_logs_test", connection, transaction);
- }
- else
- {
- save_jd_parse_logs(data, "jd_parse_logs", connection, transaction);
- if (save_dailys_log)
- {
- string daily_table = $"jd_parse_logs_{DateTime.Now:yyyyMMdd}";
- save_jd_parse_logs(data, daily_table, connection, transaction);
- }
- if (data.elapsedTime > 1000)
- {
- save_jd_parse_logs(data, "jd_parse_logs_test", connection, transaction);
- }
- if (data.success)
- {
- save_jd_parse_logs(data, "jd_parse_logs_success", connection, transaction);
- }
- }
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<DyDataDTO>(queue_parse_dy_key);
- if (data == null) break;
- new DBContext.Table(connection, "tk_parse_logs")
- .Add("end_point", data.end_point)
- .Add("channel", (int)data.channel)
- .Add("accountId", data.accountId)
- .Add("accountName", data.accountName)
- .Add("rawContent", data.rawContent)
- .Add("success", data.success)
- .Add("message", data.message)
- .Add("reason", data.reason)
- .Add("content", data.content)
- .Add("itemId", data.itemId)
- .Add("itemName", data.itemName)
- .Add("pic", data.pic)
- .Add("couponAmount", data.couponAmount)
- .Add("promotionPrice", data.promotionPrice)
- .Add("taoToken", data.taoToken)
- .Add("shortLinkurl", data.shortLinkurl)
- .Add("deeplink_url", data.deeplink_url)
- .Add("elapsedTime", data.elapsedTime)
- .Add("subCode", data.subCode)
- .Add("ip", data.ip)
- .Add("oaid", data.oaid)
- .Add("create_time", data.create_time)
- .Create(DBContext.InsertType.NORMAL, transaction);
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<ToolParseDataDTO>(queue_parse_tool_key);
- if (data == null) break;
- new DBContext.Table(connection, "tool_parse_logs")
- .Add("end_point", data.end_point)
- .Add("channel", (int)data.channel)
- .Add("rawContent", data.rawContent)
- .Add("success", data.success)
- .Add("message", data.message)
- .Add("reason", data.reason)
- .Add("content", data.content)
- .Add("taoToken", data.taoToken)
- .Add("shortLinkurl", data.shortLinkurl)
- .Add("deeplink_url", data.deeplink_url)
- .Add("elapsedTime", data.elapsedTime)
- .Add("ip", data.ip)
- .Add("oaid", data.oaid)
- .Add("create_time", data.create_time)
- .Create(DBContext.InsertType.NORMAL, transaction);
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<UnionCouponDTO>(queue_coupon_key);
- if (data == null) break;
- if ("3JDaxNfPy83okP3kLScwCkGiuMcyC4PcyntF424979CC9C51BCAD0C245B1C7BA2".Equals(data.oaid) ||
- data.ip.Contains("127.0.0"))
- {
- var test_data = data.Convert2Json().Convert2Object<TestUnionCouponDTO>();
- connection.Insert(test_data);
- }
- else
- {
- connection.Insert(data);
- if (data.success)
- {
- var success_data = data.Convert2Json().Convert2Object<SuccessUnionCouponDTO>();
- connection.Insert(success_data);
- }
- }
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<UnionCpsDTO>(queue_cps_key);
- if (data == null) break;
- if (data.ip.Contains("127.0.0"))
- {
- var test_data = data.Convert2Json().Convert2Object<TestUnionCpsDTO>();
- connection.Insert(test_data);
- }
- else
- {
- connection.Insert(data);
- if (data.success)
- {
- var success_data = data.Convert2Json().Convert2Object<SuccessUnionCpsDTO>();
- connection.Insert(success_data);
- }
- }
- total++;
- }
- for (int i = 0; i < limit; i++)
- {
- var data = redis.LPop<PromotionQueryDTO>(promotion_img_key);
- if (data == null) break;
- connection.Insert(data);
- total++;
- }
- transaction.Commit();
- }
- catch (Exception ex)
- {
- transaction.Rollback();
- _ = new LoggerLibrary("database_error", "parse_log")
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- NotifyCore.Notify(new NifyMessage
- {
- message = $"【写入日志异常】\n{ex.Message}\n{ex.StackTrace}",
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- }
- finally
- {
- connection.Close();
- }
- return total;
- }
- public static async Task PromotionImgLogAsync(PromotionQueryDTO response)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(promotion_img_key, response);
- //using var connection = DBContext.GetOpenConnection();
- //connection.Insert(response);
- savePromotionCache(response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- catch (Exception ex) { }
- }
- public static async Task LogAsync(JdDataDTO response)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_jd_key, response);
- if (!response.ip.Contains("127.0.0"))
- {
- saveCache(response.channel.ToString(), response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- }
- catch (Exception ex) { }
- }
- public static async Task LogAsync(TkDataDTO response, AlimamaPlus? alimamaPlus = null)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_tb_key, response);
- if (!response.ip.Contains("127.0.0"))
- {
- saveCache(response.channel.ToString(), response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- if (!response.success && "nologin".Equals(response.message))
- {
- switch (response.channel)
- {
- case TkChannelEnum.tb:
- await Task.Run(() =>
- {
- if (alimamaPlus != null)
- {
- (bool success, string message) = alimamaPlus.RenewCookie();
- if (success) return;
- }
- TkPoolCore.Disabled(response.accountId, response.accountName, $"{response.rawContent}\n{response.rawContent2}");
- });
- break;
- }
- }
- if ("没有匹配账号".Equals(response.reason))
- {
- TkPoolCore.AccountExhausted();
- }
- }
- catch (Exception ex)
- {
- _ = new LoggerLibrary("unionParse", "database_error")
- .Info(response.rawContent, response.rawContent2)
- .Info(response.Convert2Json())
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- }
- }
- public static async Task ParseLogAsync(TkDataDTO response, AlimamaPlus? alimamaPlus = null)
- {
- #if DEBUG
- //return;
- #endif
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_parse_tb_key, response);
- if (response.success)
- {
- _ = saveUnionCouponParseCacheAsync(response);
- }
- if (!response.ip.Contains("127.0.0"))
- {
- saveParseCache(response.channel.ToString(), response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- if (!string.IsNullOrEmpty(response.itemId)) TkOrderTrackingCore.SaveLinkSummary(response);
- if (!response.success && "nologin".Equals(response.message))
- {
- switch (response.channel)
- {
- case TkChannelEnum.tb:
- await Task.Run(() =>
- {
- if (alimamaPlus != null)
- {
- (bool success, string message) = alimamaPlus.RenewCookie();
- if (success) return;
- }
- TkPoolCore.Disabled(response.accountId, response.accountName, $"{response.rawContent}");
- }); break;
- }
- }
- }
- catch (Exception ex)
- {
- _ = new LoggerLibrary("unionParse", "database_error")
- .Info(response.rawContent)
- .Info(response.Convert2Json())
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- }
- }
- public static async Task CouponLogAsync(UnionCouponDTO response, AlimamaPlus? alimamaPlus = null)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_coupon_key, response);
- if (!response.ip.Contains("127.0.0"))
- {
- saveCouponCache(response.channel.ToString(), response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- if (!response.success && "nologin".Equals(response.message))
- {
- switch (response.channel)
- {
- case TkChannelEnum.tb:
- await Task.Run(() =>
- {
- if (alimamaPlus != null)
- {
- (bool success, string message) = alimamaPlus.RenewCookie();
- if (success) return;
- }
- TkPoolCore.Disabled(response.accountId, response.accountName, $"{response.rawContent}");
- }); break;
- }
- }
- }
- catch (Exception ex)
- {
- _ = new LoggerLibrary("unionCoupon", "database_error")
- .Info(response.rawContent)
- .Info(response.Convert2Json())
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- }
- }
- public static async Task CpsLogAsync(UnionCpsDTO response, AlimamaPlus? alimamaPlus = null)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_cps_key, response);
- if (response.success) saveClientRequestTotal(response.channel, response.ip, response.oaid);
- if (!response.ip.Contains("127.0.0"))
- {
- saveCpsCache(response.channel.ToString(), response.accountId, response.success, response.message, response.reason);
- }
- }
- catch (Exception ex)
- {
- _ = new LoggerLibrary("unionCps", "database_error")
- .Info(response.rawContent)
- .Info(response.Convert2Json())
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- }
- }
- public static async Task ParseLogAsync(JdDataDTO response)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_parse_jd_key, response);
- if (!response.ip.Contains("127.0.0"))
- {
- saveParseCache(response.channel.ToString(), response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- if (response.success || response.message.Equals("转链失败"))
- {
- JdPoolCore.CallsIncrBy(response.accountId);
- }
- //CallsIncrBy
- if (response.success) saveClientRequestTotal(response.channel, response.ip, response.oaid);
- if (!response.success && ("nologin".Equals(response.reason) ||
- "方法不存在".Equals(response.reason) ||
- "未登录".Equals(response.reason)))
- {
- await Task.Run(() =>
- {
- JdPoolCore.Disabled(response.accountId, response.accountName, $"{response.rawContent}\n{response.rawContent2}");
- });
- //switch (response.channel)
- //{
- // case TkChannelEnum.tb:
- // //await Task.Run(() =>
- // //{
- // // if (alimamaPlus != null)
- // // {
- // // (bool success, string message) = alimamaPlus.RenewCookie();
- // // if (success) return;
- // // }
- // // TkPoolCore.Disabled(response.accountId, response.accountName, $"{response.rawContent}\n{response.rawContent2}");
- // //});
- // break;
- //}
- }
- if ("没有匹配账号".Equals(response.reason))
- {
- JdPoolCore.AccountExhausted();
- }
- }
- catch (Exception ex) { }
- }
- public static async Task ParseLogAsync(DyDataDTO response)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_parse_dy_key, response);
- if (!response.ip.Contains("127.0.0"))
- {
- saveParseCache(response.channel.ToString(), response.accountId, response.accountName, response.success, response.message, response.reason);
- }
- }
- catch (Exception ex) { }
- }
- public static async Task ParseLogAsync(ToolParseDataDTO response)
- {
- try
- {
- var ts = DateTime.Now - response.create_time;
- response.elapsedTime = (int)ts.TotalMilliseconds;
- _ = RedisHelper.RPushAsync(queue_parse_tool_key, response);
- if (!response.ip.Contains("127.0.0"))
- {
- saveParseCache(response.channel.ToString(), 0, "tool", response.success, response.message, response.reason);
- }
- }
- catch (Exception ex) { }
- }
- private static void saveCache(string channel, int accountId, string accountName, bool success, string message, string reason)
- {
- saveAccountCache("all", success, message, reason);
- saveAccountCache($"{channel}", success, message, reason);
- saveAccountCache($"{accountName}", success, message, reason);
- if (accountId != 0)
- {
- //todo 放着跑两天,要将读取的地方改成读取accountid
- saveAccountCache($"{channel}_{accountId}", success, message, reason);
- }
- }
- private static void saveAccountCache(string accountName, bool success, string message, string reason)
- {
- RedisHelper.IncrBy($":total:{accountName}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":total:{accountName}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":total:{accountName}:{DateTime.Now:yyyyMMddHH}");
- string result = success ? "success" : "fail";
- RedisHelper.IncrBy($":total:{accountName}:{result}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":total:{accountName}:{result}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":total:{accountName}:{result}:{DateTime.Now:yyyyMMddHH}");
- if (!string.IsNullOrEmpty(message))
- {
- RedisHelper.SAdd($":total:{accountName}:message:{DateTime.Now:yyyyMM}", message);
- RedisHelper.SAdd($":total:{accountName}:message:{DateTime.Now:yyyyMMdd}", message);
- RedisHelper.SAdd($":total:{accountName}:message:{DateTime.Now:yyyyMMddHH}", message);
- RedisHelper.IncrBy($":total:{accountName}:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":total:{accountName}:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":total:{accountName}:{message}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":total:{accountName}:message:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":total:{accountName}:message:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":total:{accountName}:message:{message}:{DateTime.Now:yyyyMMddHH}");
- }
- if (!string.IsNullOrEmpty(reason))
- {
- RedisHelper.SAdd($":total:{accountName}:reason:{DateTime.Now:yyyyMM}", reason);
- RedisHelper.SAdd($":total:{accountName}:reason:{DateTime.Now:yyyyMMdd}", reason);
- RedisHelper.SAdd($":total:{accountName}:reason:{DateTime.Now:yyyyMMddHH}", reason);
- RedisHelper.IncrBy($":total:{accountName}:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":total:{accountName}:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":total:{accountName}:{reason}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMddHH}");
- }
- }
- private static async Task saveUnionCouponParseCacheAsync(TkDataDTO data)
- {
- string cacheKey = $":cache:parse:{data.ip}_{data.oaid}_{data.itemId}";
- await EndPointCore.ProcessEndPointNodesAsync(node =>
- {
- if (!node.is_coupon_api) return Task.CompletedTask;
- if (string.IsNullOrEmpty(node.redis_server)) return Task.CompletedTask;
- var redis = RedisClientManager.GetRedisClient(node.redis_server);
- redis.Set(cacheKey, 1, 2 * 86400);
- return Task.CompletedTask;
- });
- }
- private static void saveClientRequestTotal(TkChannelEnum channel, string ip, string oaid)
- {
- string cacheKey = $":cache:{channel}:ip:{DateTime.Now:yyyyMMdd}:{ip}";
- RedisHelper.IncrBy(cacheKey);
- RedisHelper.Expire(cacheKey, 86400);
- if (!string.IsNullOrEmpty(oaid))
- {
- cacheKey = $":cache:{channel}:oaid:{DateTime.Now:yyyyMMdd}:{oaid}";
- RedisHelper.IncrBy(cacheKey);
- RedisHelper.Expire(cacheKey, 86400);
- }
- }
- public static int getClientRequestTotalByOAID(TkChannelEnum channel, string oaid)
- {
- if (string.IsNullOrEmpty(oaid)) return 0;
- string cacheKey = $":cache:{channel}:oaid:{DateTime.Now:yyyyMMdd}:{oaid}";
- return RedisHelper.Get<int>(cacheKey);
- }
- public static int getClientRequestTotalByIp(TkChannelEnum channel, string ip)
- {
- if (string.IsNullOrEmpty(ip)) return 0;
- string cacheKey = $":cache:{channel}:ip:{DateTime.Now:yyyyMMdd}:{ip}";
- return RedisHelper.Get<int>(cacheKey);
- }
- private static void saveClientRequestTotal(CpsChannelEnum channel, string ip, string oaid)
- {
- string cacheKey = $":cache:cps_{channel}:ip:{DateTime.Now:yyyyMMdd}:{ip}";
- RedisHelper.IncrBy(cacheKey);
- RedisHelper.Expire(cacheKey, 86400);
- if (!string.IsNullOrEmpty(oaid))
- {
- cacheKey = $":cache:cps_{channel}:oaid:{DateTime.Now:yyyyMMdd}:{oaid}";
- RedisHelper.IncrBy(cacheKey);
- RedisHelper.Expire(cacheKey, 86400);
- }
- }
- public static int getClientRequestTotalByOAID(CpsChannelEnum channel, string oaid)
- {
- if (string.IsNullOrEmpty(oaid)) return 0;
- string cacheKey = $":cache:cps_{channel}:oaid:{DateTime.Now:yyyyMMdd}:{oaid}";
- return RedisHelper.Get<int>(cacheKey);
- }
- public static int getClientRequestTotalByIp(CpsChannelEnum channel, string ip)
- {
- if (string.IsNullOrEmpty(ip)) return 0;
- string cacheKey = $":cache:cps_{channel}:ip:{DateTime.Now:yyyyMMdd}:{ip}";
- return RedisHelper.Get<int>(cacheKey);
- }
- private static void saveParseCache(string channel, int accountId, string accountName, bool success, string message, string reason)
- {
- saveParseAccountCache("all", success, message, reason);
- saveParseAccountCache($"{channel}", success, message, reason);
- saveParseAccountCache($"{accountName}", success, message, reason);
- if (accountId != 0)
- {
- //todo 放着跑两天,要将读取的地方改成读取accountid
- saveParseAccountCache($"{channel}_{accountId}", success, message, reason);
- }
- }
- private static void saveParseAccountCache(string accountName, bool success, string message, string reason)
- {
- RedisHelper.IncrBy($":parse_total:{accountName}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{DateTime.Now:yyyyMMddHH}");
- string result = success ? "success" : "fail";
- RedisHelper.IncrBy($":parse_total:{accountName}:{result}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{result}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{result}:{DateTime.Now:yyyyMMddHH}");
- if (!string.IsNullOrEmpty(message))
- {
- RedisHelper.SAdd($":parse_total:{accountName}:message:{DateTime.Now:yyyyMM}", message);
- RedisHelper.SAdd($":parse_total:{accountName}:message:{DateTime.Now:yyyyMMdd}", message);
- RedisHelper.SAdd($":parse_total:{accountName}:message:{DateTime.Now:yyyyMMddHH}", message);
- RedisHelper.IncrBy($":parse_total:{accountName}:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{message}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":parse_total:{accountName}:message:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":parse_total:{accountName}:message:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":parse_total:{accountName}:message:{message}:{DateTime.Now:yyyyMMddHH}");
- }
- if (!string.IsNullOrEmpty(reason))
- {
- RedisHelper.SAdd($":parse_total:{accountName}:reason:{DateTime.Now:yyyyMM}", reason);
- RedisHelper.SAdd($":parse_total:{accountName}:reason:{DateTime.Now:yyyyMMdd}", reason);
- RedisHelper.SAdd($":parse_total:{accountName}:reason:{DateTime.Now:yyyyMMddHH}", reason);
- RedisHelper.IncrBy($":parse_total:{accountName}:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":parse_total:{accountName}:{reason}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":parse_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":parse_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":parse_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMddHH}");
- }
- }
- private static void savePromotionCache(int accountId, string accountName, bool success, string message, string reason)
- {
- savePromotionAccountCache("all", success, message, reason);
- savePromotionAccountCache($"{accountId}", success, message, reason);
- }
- private static void savePromotionAccountCache(string accountName, bool success, string message, string reason)
- {
- RedisHelper.IncrBy($":promotion_total:{accountName}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{DateTime.Now:yyyyMMddHH}");
- string result = success ? "success" : "fail";
- RedisHelper.IncrBy($":promotion_total:{accountName}:{result}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{result}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{result}:{DateTime.Now:yyyyMMddHH}");
- if (!string.IsNullOrEmpty(message))
- {
- RedisHelper.SAdd($":promotion_total:{accountName}:message:{DateTime.Now:yyyyMM}", message);
- RedisHelper.SAdd($":promotion_total:{accountName}:message:{DateTime.Now:yyyyMMdd}", message);
- RedisHelper.SAdd($":promotion_total:{accountName}:message:{DateTime.Now:yyyyMMddHH}", message);
- RedisHelper.IncrBy($":promotion_total:{accountName}:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{message}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:message:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:message:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:message:{message}:{DateTime.Now:yyyyMMddHH}");
- }
- if (!string.IsNullOrEmpty(reason))
- {
- RedisHelper.SAdd($":promotion_total:{accountName}:reason:{DateTime.Now:yyyyMM}", reason);
- RedisHelper.SAdd($":promotion_total:{accountName}:reason:{DateTime.Now:yyyyMMdd}", reason);
- RedisHelper.SAdd($":promotion_total:{accountName}:reason:{DateTime.Now:yyyyMMddHH}", reason);
- RedisHelper.IncrBy($":promotion_total:{accountName}:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:{reason}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":promotion_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMddHH}");
- }
- }
- private static void saveCouponCache(string channel, int accountId, string accountName, bool success, string message, string reason)
- {
- saveAccountCouponCache("all", success, message, reason);
- saveAccountCouponCache($"{channel}", success, message, reason);
- if (accountId != 0)
- {
- saveAccountCouponCache($"{channel}_{accountId}", success, message, reason);
- }
- }
- private static void saveAccountCouponCache(string accountName, bool success, string message, string reason)
- {
- RedisHelper.IncrBy($":coupon_total:{accountName}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{DateTime.Now:yyyyMMddHH}");
- string result = success ? "success" : "fail";
- RedisHelper.IncrBy($":coupon_total:{accountName}:{result}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{result}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{result}:{DateTime.Now:yyyyMMddHH}");
- if (!string.IsNullOrEmpty(message))
- {
- RedisHelper.SAdd($":coupon_total:{accountName}:message:{DateTime.Now:yyyyMM}", message);
- RedisHelper.SAdd($":coupon_total:{accountName}:message:{DateTime.Now:yyyyMMdd}", message);
- RedisHelper.SAdd($":coupon_total:{accountName}:message:{DateTime.Now:yyyyMMddHH}", message);
- RedisHelper.IncrBy($":coupon_total:{accountName}:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{message}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:message:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:message:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:message:{message}:{DateTime.Now:yyyyMMddHH}");
- }
- if (!string.IsNullOrEmpty(reason))
- {
- RedisHelper.SAdd($":coupon_total:{accountName}:reason:{DateTime.Now:yyyyMM}", reason);
- RedisHelper.SAdd($":coupon_total:{accountName}:reason:{DateTime.Now:yyyyMMdd}", reason);
- RedisHelper.SAdd($":coupon_total:{accountName}:reason:{DateTime.Now:yyyyMMddHH}", reason);
- RedisHelper.IncrBy($":coupon_total:{accountName}:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:{reason}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":coupon_total:{accountName}:reason:{reason}:{DateTime.Now:yyyyMMddHH}");
- }
- }
- private static void saveCpsCache(string channel, int accountId, bool success, string message, string reason)
- {
- saveAccountCpsCache("all", success, message, reason);
- saveAccountCpsCache($"{channel}", success, message, reason);
- if (accountId != 0)
- {
- saveAccountCpsCache($"{channel}_{accountId}", success, message, reason);
- }
- }
- private static void saveAccountCpsCache(string flagName, bool success, string message, string reason)
- {
- RedisHelper.IncrBy($":cps_total:{flagName}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{DateTime.Now:yyyyMMddHH}");
- string result = success ? "success" : "fail";
- RedisHelper.IncrBy($":cps_total:{flagName}:{result}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{result}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{result}:{DateTime.Now:yyyyMMddHH}");
- if (!string.IsNullOrEmpty(message))
- {
- RedisHelper.SAdd($":cps_total:{flagName}:message:{DateTime.Now:yyyyMM}", message);
- RedisHelper.SAdd($":cps_total:{flagName}:message:{DateTime.Now:yyyyMMdd}", message);
- RedisHelper.SAdd($":cps_total:{flagName}:message:{DateTime.Now:yyyyMMddHH}", message);
- RedisHelper.IncrBy($":cps_total:{flagName}:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{message}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":cps_total:{flagName}:message:{message}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":cps_total:{flagName}:message:{message}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":cps_total:{flagName}:message:{message}:{DateTime.Now:yyyyMMddHH}");
- }
- if (!string.IsNullOrEmpty(reason))
- {
- RedisHelper.SAdd($":cps_total:{flagName}:reason:{DateTime.Now:yyyyMM}", reason);
- RedisHelper.SAdd($":cps_total:{flagName}:reason:{DateTime.Now:yyyyMMdd}", reason);
- RedisHelper.SAdd($":cps_total:{flagName}:reason:{DateTime.Now:yyyyMMddHH}", reason);
- RedisHelper.IncrBy($":cps_total:{flagName}:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":cps_total:{flagName}:{reason}:{DateTime.Now:yyyyMMddHH}");
- RedisHelper.IncrBy($":cps_total:{flagName}:reason:{reason}:{DateTime.Now:yyyyMM}");
- RedisHelper.IncrBy($":cps_total:{flagName}:reason:{reason}:{DateTime.Now:yyyyMMdd}");
- RedisHelper.IncrBy($":cps_total:{flagName}:reason:{reason}:{DateTime.Now:yyyyMMddHH}");
- }
- }
- public static int GetTotal(string keyname, bool all_node = true)
- {
- //:coupon_total:tb:20240706
- //:coupon_total:tb:success:20240706
- //:coupon_total:tb:放弃转链:20240706
- var result = EndPointCore.ProcessEndPointNodes<int>(node =>
- {
- if (!node.is_public_api) return 0;
- if (string.IsNullOrEmpty(node.redis_server)) return 0;
- if (!all_node)
- {
- if (CenterHub.IsCenter)
- {
- if (node.is_coupon_api) { return 0; }
- }
- else
- {
- if (!node.is_coupon_api) { return 0; }
- }
- }
- #if DEBUG
- switch (node.name)
- {
- case "bj":
- node.redis_server = "101.200.46.46:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=webhook";
- break;
- case "gz":
- node.redis_server = "8.138.110.158:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=webhook";
- break;
- case "coupon1":
- node.redis_server = "c1api.molilian.com:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=coupon";
- break;
- default: return 0;
- }
- #endif
- var redis = RedisClientManager.GetRedisClient(node.redis_server);
- int count = redis.Get<int>(keyname);
- return count;
- });
- return result.Sum();
- }
- public static string[] GetTotalKeys(string keyname, bool all_node = true)
- {
- var result = EndPointCore.ProcessEndPointNodes<string[]>(node =>
- {
- if (!node.is_public_api) return [];
- if (string.IsNullOrEmpty(node.redis_server)) return [];
- if (!all_node)
- {
- if (CenterHub.IsCenter)
- {
- if (node.is_coupon_api) { return []; }
- }
- else
- {
- if (!node.is_coupon_api) { return []; }
- }
- }
- #if DEBUG
- switch (node.name)
- {
- case "bj":
- node.redis_server = "101.200.46.46:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=webhook";
- break;
- case "gz":
- node.redis_server = "8.138.110.158:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=webhook";
- break;
- case "coupon1":
- node.redis_server = "c1api.molilian.com:6379,password=pKBiS4ka2IpXayIdcx00,defaultDatabase=0,idleTimeout=20000,preheat=3,tryit=2,ssl=false,prefix=coupon";
- break;
- default: return [];
- }
- #endif
- var redis = RedisClientManager.GetRedisClient(node.redis_server);
- string[] message_keys = redis.SMembers(keyname);
- return message_keys;
- });
- string[] message_keys = [];
- foreach (var arr in result)
- {
- message_keys = message_keys.Union(arr).ToArray();
- }
- return message_keys;
- }
- //if (item.total_count > 0) continue;
- //item.total_count = RedisHelper.Get<int>($":total:all:{item.report_date:yyyyMMdd}");
- //if (item.total_count == 0) continue;
- //item.success_count = RedisHelper.Get<int>($":total:all:success:{item.report_date:yyyyMMdd}");
- //item.abandon_count = RedisHelper.Get<int>($":total:all:放弃转链:{item.report_date:yyyyMMdd}");
- }
- }
|