dodo hold 1 gadu atpakaļ
vecāks
revīzija
5f9eafa1d0

+ 2 - 2
molilian.api/Controllers/public/TaskController.cs

@@ -336,8 +336,8 @@ namespace molilian.api.Controllers
         {
             try
             {
-                AlimamaPlus.ApiCallStatistics(1, intervalDay, TkChannelEnum.tb);
-                AlimamaPlus.ApiCallStatistics(2, intervalDay, TkChannelEnum.tb);
+                //AlimamaPlus.ApiCallStatistics(1, intervalDay, TkChannelEnum.tb);
+                //AlimamaPlus.ApiCallStatistics(2, intervalDay, TkChannelEnum.tb);
                 AlimamaPlus.ApiCallStatistics(1, intervalDay, TkChannelEnum.jd);
             }
             catch (Exception ex)

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
molilian.api/Properties/PublishProfiles/https___ccr.ccs.tencentyun.com_shaobin.pubxml.user


+ 15 - 1
molilian.core/Core/API/ApiReportCore.cs

@@ -10,6 +10,7 @@ namespace molilian.core
         public class RecordDTO
         {
             public int id { get; set; }
+            public int platform { get; set; }
             public int data_type { get; set; }
             public DateTime report_date { get; set; }
             public int uclk_uv { get; set; } = 0;
@@ -90,7 +91,12 @@ namespace molilian.core
 
         public static async Task<List<dynamic>> DataTypeReportDailysAsync(int platform, int distributiontype, int data_type, DateTime stime, DateTime etime, string clientIp, bool debug = false)
         {
-            string filter = "`is_show`=@is_show AND platform=@platform AND data_type=@data_type AND report_date>=@stime AND report_date<=@etime";
+            string filter = "`is_show`=@is_show AND data_type=@data_type AND report_date>=@stime AND report_date<=@etime";
+            if (platform > 0)
+            {
+                filter = "`is_show`=@is_show AND data_type=@data_type AND platform=@platform AND report_date>=@stime AND report_date<=@etime";
+                platform -= 1;
+            }
             string orderBy = "report_date DESC";
 
             var list = new DBContext.Table("api_call_report_dailys")
@@ -120,6 +126,7 @@ namespace molilian.core
 
                 data = list.Select(e => new
                 {
+                    platform = e.platform + 1,
                     report_date = e.report_date.ToString("yyyy-MM-dd"),
                     type = e.data_type,
                     e.uclk_uv,
@@ -157,6 +164,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             //metric_type = "req_goods_num",
                             //metric_value = e.req_goods_num,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
@@ -182,6 +190,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
                             type = e.data_type,
                             e.uclk_uv,
@@ -205,6 +214,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
                             type = e.data_type,
                             e.uclk_uv,
@@ -228,6 +238,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
                             type = e.data_type,
                             e.uclk_uv,
@@ -251,6 +262,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
                             type = e.data_type,
                             e.uclk_uv,
@@ -275,6 +287,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
                             type = e.data_type,
                             e.uclk_uv,
@@ -300,6 +313,7 @@ namespace molilian.core
                     {
                         results.Add(new
                         {
+                            platform = e.platform + 1,
                             report_date = e.report_date.ToString("yyyy-MM-dd"),
                             type = e.data_type,
                             e.uclk_uv,

+ 11 - 1
molilian.core/Core/EndPointCore.cs

@@ -22,6 +22,16 @@ namespace molilian.core
     {
         private static readonly object _lockObj = new();
         private static IEnumerable<EndPointDTO> _cached;
+
+
+        public static string CurrentEndPoint { get; set; }
+        static EndPointCore()
+        {
+            CurrentEndPoint = Environment.GetEnvironmentVariable("EndPoint");
+        }
+
+
+
         public static IDbConnection GetDbConnection(string connString)
         {
             var conn = new MySqlConnection(connString);
@@ -116,7 +126,7 @@ Server=rm-2ze74506m3gfsqe7mco.rwlb.rds.aliyuncs.com; Port=3306; Database=coupon;
             }
             return resultList;
         }
-        
+
         public static async Task ProcessEndPointNodesAsync(Func<EndPointDTO, Task> nodeAction, bool force = false)
         {
             var list = List(force);

+ 26 - 9
molilian.core/Core/taoke/UnionParseCore.cs

@@ -25,6 +25,7 @@ using System.Text.RegularExpressions;
 using static dodohold.core.ZTOExpress.CreateOrderArgs;
 using System.Security.Cryptography;
 using System.Threading.Channels;
+using TencentCloud.Tke.V20180525.Models;
 
 
 namespace molilian.core
@@ -245,16 +246,18 @@ namespace molilian.core
                     _ = TkLogCore.ParseLogAsync(result);
 
 
-                    //20241108 特例
-                    string ruleKey = $"tmp_rules:{DateTime.Now:yyyyMMdd}";
-                    var count = RedisHelper.IncrBy(ruleKey);
-                    if (DateTime.Now < DateTime.Parse("2024-11-11") && count < 2500)
-                    {
-                        //"https://s.click.taobao.com/t?union_lens=lensId%3APUB%401730991020%400bbb0a39_0e75_193071ad936_c566%4001%40eyJmbG9vcklkIjozODg1Miiwiic3BtQiiI6Il9wb3J0YWxfdjJfcGFnZXNfYWN0aXZpdHlfb2ZmaWNpYWxfaW5kZXhfaHRtIn0ie%3BeventPageId%3A20150318020007201&e=m%3D2%26s%3DipuVKjYImbNw4vFB6t2Z2iperVdZeJviU%2F9%2F0taeK29yINtkUhsv0KWvzu%2FHMi3%2BFPhC4MirEWStw6LBB4w3HYXT%2BqQ2P5OIQVNSryTmvs7YddWYbxmvGTMNfihJN%2FGnAGIx0oe2X2hZfJ7ZQxC1%2FU3rpAhWgptfEBnEBk3xaGylLmcSHKfaX1CIFRJhZoJ2keMqUwSQcLRC0TzsMy8kp7Hfv3%2BBYcPW3eHn14rW1PB5SunYCHQHRbw6LwQYf%2F1JuyhJem%2BM5OoR2cbDLktPLiIOenYkFIXa2HzNl%2Bm1VXoil%2F2L3b1aA6a%2FoVHlY%2BqZ2kyLuBX5NHCAQVYCmAmuozC39JfnbJNrE%2FSR3F9BSjOYe76q6w0hyfybhwAASyyp5XMWEyz25ulHMwkL2n%2F7nNBiFmadXyjFDPu12TgSnbZtfjDbrVTLHb6MowVEq7z9LgOFRSuRLesvlLykGd2CaRk8ezhE61zXa8yR1eex6ip3KqbOh7CEmgCLaFxcnT%2BrGuviRFaBil8Mlu5kMKse3g%3D%3D";
 
-                        string hb_url = "https://s.click.taobao.com/t?union_lens=lensId%3APUB%401730991060%400b510772_0df6_193071b768d_210f%4001%40eyJmbG9vcklkIjozODg1Miiwiic3BtQiiI6Il9wb3J0YWxfdjJfcGFnZXNfYWN0aXZpdHlfb2ZmaWNpYWxfaW5kZXhfaHRtIn0ie%3BeventPageId%3A20150318020016843&e=m%3D2%26s%3DA1AHKD9F7Nhw4vFB6t2Z2iperVdZeJviU%2F9%2F0taeK29yINtkUhsv0KWvzu%2FHMi3%2Bh1wntvOGDCytw6LBB4w3HYXT%2BqQ2P5OIQVNSryTmvs7eznT8c0%2BOxucX6%2FIvhSD5AGIx0oe2X2hZfJ7ZQxC1%2FU3rpAhWgptfEBnEBk3xaGylLmcSHKfaX1CIFRJhZoJ2keMqUwSQcLRC0TzsMy8kp7Hfv3%2BBYcPW3eHn14rW1PB5SunYCHQHRbw6LwQYf%2F1JuyhJem%2BM5OoR2cbDLktPLiIOenYkFIXaB%2FWmSjJ%2FDetdnBNxJusisiH18dRGjHzjUh%2Bx4%2Bh6gbwLqirZAkaxvnIKgJtaeeuKsJkGnmNeMxV2b5AccURU%2FXqss%2B9QPoF86hteE8NJKpolfPKodRMJmRfFCEuMVaVFTjJ9EustsCzTbaXzU0HzGQ3G0oSVAhvq8dJ646N9%2BfPG7KP%2FW7aJTlBg0B0VOPmAfTYWTuIBgHgsBQ1POZZlkf%2BtQEx4g%2BcAxnAryvg3Dknnic12Z1shopsQ%2FFWmC5aPxgxdTc00KD8%3D";
-                        result.deeplink_url = AlimamaPlus.GetDeeplink(hb_url);
-                        RedisHelper.Expire(ruleKey, 86400 * 10);
+
+                    //20241204 特例
+                    if ("bj".Equals(EndPointCore.CurrentEndPoint))
+                    {
+                        string ruleKey = $"tmp_rules:tb:{DateTime.Now:yyyyMMdd}";
+                        var count = RedisHelper.IncrBy(ruleKey);
+                        if (DateTime.Now < DateTime.Parse("2024-12-05") && count < 500)
+                        {
+                            result.deeplink_url = "tbopen://m.taobao.com/tbopen/index.html?action=ali.open.nav&module=h5&source=alimama&bc_fl_src=tunion_vipmedia_sy&h5Url=https%3A%2F%2Fs.click.taobao.com%2Ft%3Funion_lens%3DlensId%253APUB%25401733285378%25402105593d_0f2e_1938fdbfb08_56d2%254001%2540eyJmbG9vcklkIjozODg1Miiwiic3BtQiiI6Il9wb3J0YWxfdjJfcGFnZXNfYWN0aXZpdHlfb2ZmaWNpYWxfaW5kZXhfaHRtIn0ie%253BeventPageId%253A20150318020019405%26e%3Dm%253D2%2526s%253DHT55zNJ42uRw4vFB6t2Z2iperVdZeJviAMbqNcPEYg76sTlfBitgxDLxqsKAeUFqgEGu%252B0FGP7cWpIFXOotQwxwkghS%252B3Tth35QMLhvYd5WzAlsM3q9KBQgChlAI37hjOkwAUKujKr8%252BB0zf4OD7u5LL0QPsyT77slidLc%252FfR2bfW12dRBt0XJ7LmQijlljrM7kxpdONUAKgtf8I59Gmj7WOELdnGdZV3eHn14rW1PBcfk1oQPCr5xDqzYVRkKA1NNRdkxXQuw4cJIIUvt07Yd%252BUDC4b2HeVswJbDN6vSgUIAoZQCN%252B4Y859REbZnVo89hl0nxWy%252BeTjkOUQ%252FOHRwAPUBlppf%252Btjs7UNLsd2bI5z8saC7t5FlO9Zh8BraVZYIcqHs8UcdUpXL0nm%252FTxRaQ4VydfXBQxnSpQpV4IkRoOOqZbKHGSDxYLRK9woGjcZwM7sKH2NkQIJ%252Fov1pArqR5rCLGafPO1NzTpSwSQKdJD1UZJeBohmpzCclrzRGqIlouD5cf%252BfoU5VXRkZOvK%252FVyaa21c5k%252BY9DYGmadGiXn0jUIaYy7GzzyoG4bBR4UOYsQQxcVtq4KEjiVO%252FBgG2pWuj0Yecd3Dfdij0RQXJBsf3Oqj9M98VWj7lCjCC8ck8";
+                            RedisHelper.Expire(ruleKey, 86400 * 1);
+                        }
                     }
                     other_aff = true;
                     return TaobaoParseOutput(result, swData, new
@@ -531,6 +534,20 @@ namespace molilian.core
                         _ => JdUnionPlus.GetDeeplink(string.Empty),
                     };
 
+                    if (result.link_type == LinkTypeEnum.other_aff)
+                    {
+                        //20241204 特例
+                        if ("bj".Equals(EndPointCore.CurrentEndPoint))
+                        {
+                            string ruleKey = $"tmp_rules:jd:{DateTime.Now:yyyyMMdd}";
+                            var count = RedisHelper.IncrBy(ruleKey);
+                            if (DateTime.Now < DateTime.Parse("2024-12-06") && count < 500)
+                            {
+                                result.deeplink_url = "openapp.jdmobile://virtual?params=%7B%22des%22%3A%22union%22%2C%22category%22%3A%22jump%22%2C%22url%22%3A%22https%3A%2F%2Fu.jd.com%2FugInesd%3Fe%3DCPS-11417-__ZLDEVICE__-CPS-wkfG72%22%7D&backurl=__back_url__";
+                                RedisHelper.Expire(ruleKey, 86400 * 1);
+                            }
+                        }
+                    }
                     result.success = false;
                     result.message = "放弃转链";
                     result.reason = reason;

+ 9 - 0
molilian.core/Plus/Alimama/orders.cs

@@ -463,6 +463,7 @@ SET  order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + ord
                             .Info(body)
                             .SaveAsync();
 #endif
+
                         if (body.Contains("{\"action\":\"captcha\""))
                         {
                             string message = $"【GetTkOrders】【{_accountId}:{_accountName}】第 {i} 次出现滑动验证码";
@@ -518,6 +519,13 @@ SET  order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + ord
                 }
                 catch (Exception ex)
                 {
+                        _ = new LoggerLibrary("debug", "GetTkOrders")
+                            .Info(body)
+                            .SaveAsync();
+                    string message = $"【GetRawItemId】{_accountId}:{_accountName}\t{_proxy?.Address}\n" +
+                        $"{body}\n{ex.Message}\n{ex.StackTrace}";
+
+                    if (sleep > 0) Thread.Sleep(sleep);
                     throw new APIException(body);
                 }
                 using var conn = DBContext.GetOpenConnection();
@@ -555,6 +563,7 @@ SET  order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + ord
                 }
                 catch (Exception ex)
                 {
+                    if (sleep > 0) Thread.Sleep(sleep);
                     throw;
                 }
                 finally

+ 1 - 1
molilian.core/Plus/Alimama/parse.cs

@@ -51,7 +51,7 @@ namespace molilian.core
             _floorId = account.floorId;
             _refpid = account.refpid;
             _cookies = account.cookies;
-            _user_agent = account.user_agent;
+            _user_agent = account.user_agent?.Trim();
             if (!string.IsNullOrEmpty(account.nodeName))
             {
                 _proxy = ProxyNodesCore.GetOne(account.nodeName);

+ 1 - 1
molilian.core/Plus/JDUnion/H5stHack.cs

@@ -14,7 +14,7 @@ namespace molilian.core
 
             var args = new
             {
-                version = "4.9.4",
+                version = "4.9.6",
                 body = querystring,
                 pin = _account.pin,
                 ua = _account.user_agent,

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels