Răsfoiți Sursa

修复部分日常bug

dodo hold 1 an în urmă
părinte
comite
5ac168a20a

+ 1 - 1
molilian.api/Controllers/admin/ConfigController.cs

@@ -62,7 +62,7 @@ namespace molilian.api.Controllers
             int result = await conn.UpdateAsync<TkConfigDTO>(form);
 
             var endpoint = EndPointCore.GetCouponAdmin();
-            if (!string.IsNullOrEmpty(endpoint.db_server))
+            if (endpoint != null && !string.IsNullOrEmpty(endpoint.db_server))
             {
                 using var conn2 = EndPointCore.GetDbConnection(endpoint.db_server);
                 _ = await conn2.UpdateAsync<TkConfigDTO>(form);

+ 5 - 5
molilian.api/Controllers/admin/ReportController.cs

@@ -76,18 +76,18 @@ namespace molilian.api.Controllers
                 .Page(size, page)
                 .Order(orderBy)
                 .PageList<DailyLogsDTO>(getTotal);
-             
-            var jd_accounts = await JdPoolCore.AllListAsync();
+
+            var jd_accounts = new DBContext.Table("jd_pool").Select<JdPoolDTO>();
             var jd_hide_ids = jd_accounts.Where(e => e.is_hide).Select(e => e.id).ToList();
             result.List = result.List.Where(e => e.channel != 1 || !jd_hide_ids.Contains(e.accountId));
 
 
-            var tb_accounts = await TkPoolCore.AllListAsync();
+            var tb_accounts = new DBContext.Table("tk_pool").Select<TkPoolDTO>();
             var tb_hide_ids = tb_accounts.Where(e => e.is_hide).Select(e => e.id).ToList();
             result.List = result.List.Where(e => e.channel != 0 || !tb_hide_ids.Contains(e.accountId));
 
-            var pdd_accounts = await PddPoolCore.AllListAsync();
-            var pdd_hide_ids = tb_accounts.Where(e => e.is_hide).Select(e => e.id).ToList();
+            var pdd_accounts = new DBContext.Table("pdd_pool").Select<PddPoolDTO>();
+            var pdd_hide_ids = pdd_accounts.Where(e => e.is_hide).Select(e => e.id).ToList();
             result.List = result.List.Where(e => e.channel != 3 || !pdd_hide_ids.Contains(e.accountId));
 
             return new APIResult(new { data = result });

+ 14 - 1
molilian.api/Controllers/public/TaskController.cs

@@ -27,7 +27,7 @@ namespace molilian.api.Controllers
             _accessor = accessor;
         }
 
-
+        
         [HttpGet]
         public async Task<ActionResult> FillPushReortData(DateTime date = default)
         {
@@ -594,6 +594,9 @@ namespace molilian.api.Controllers
             }
 
             string filter = "";
+#if DEBUG
+            filter = "id IN (37, 15)";
+#endif
             var jd_list = new DBContext.Table("jd_pool").Where(filter, null).Select<JdPoolDTO>();
             if (jd_list != null)
             {
@@ -620,6 +623,12 @@ namespace molilian.api.Controllers
                         continue;
                     }
                     if (!account.status) continue;
+
+                    string lockKey = $"lock:exception:sleep:jd_{account.id}";
+                    if (!string.IsNullOrEmpty(RedisHelper.Get(lockKey))) continue;
+
+
+
                     if (!string.IsNullOrEmpty(account.cookies))
                     {
                         try
@@ -644,6 +653,10 @@ namespace molilian.api.Controllers
                                 account.status = false;
                                 _ = JdPoolCore.DisabledAsync(account.id, account.name, ex.Message);
                             }
+                            else
+                            {
+                                RedisHelper.Set(lockKey, 1, 3600);
+                            }
                             message = $"【JD报表接口异常】{account.id}:{account.name}\tqueryTodaySpreadEffectData\n{ex.Message}\n{ex.StackTrace}";
                             NotifyCore.Notify(message);
                             continue;

Fișier diff suprimat deoarece este prea mare
+ 0 - 0
molilian.api/Properties/PublishProfiles/latest.pubxml.user


Fișier diff suprimat deoarece este prea mare
+ 0 - 0
molilian.api/Properties/PublishProfiles/tester.pubxml.user


+ 1 - 1
molilian.api/molilian.api.csproj

@@ -12,7 +12,7 @@
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'" />
 
   <ItemGroup>
-    <PackageReference Include="dodohold.core" Version="1.0.1.17" />
+    <PackageReference Include="dodohold.core" Version="1.0.1.18" />
     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.20.0-Preview.1" />
     <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
   </ItemGroup>

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

@@ -69,7 +69,7 @@ namespace molilian.core
 
 
 #if DEBUG
-            item.db_server = "Server=rm-2ze74506m3gfsqe7mco.rwlb.rds.aliyuncs.com; Port=3306; Database=coupon; Uid=coupon; Pwd=67ktWBmw5G4yMs4J;SslMode=None;CharSet=utf8mb4;ConnectionTimeout=60;";
+           // item.db_server = "Server=rm-2ze74506m3gfsqe7mco.rwlb.rds.aliyuncs.com; Port=3306; Database=coupon; Uid=coupon; Pwd=67ktWBmw5G4yMs4J;SslMode=None;CharSet=utf8mb4;ConnectionTimeout=60;";
 #endif
             /*   
 Server=rm-2zey1jqxnoqy9mcc0zo.rwlb.rds.aliyuncs.com; Port=3306; Database=taoke; Uid=taoke; Pwd=67ktWBmw5G4yMs4J;SslMode=None;CharSet=utf8mb4;ConnectionTimeout=60

+ 4 - 0
molilian.core/Core/PushDataReport/PushDataReportCore.cs

@@ -211,6 +211,10 @@ namespace molilian.core
                 var response = await plus.PushReportData(item, cancellationToken);
 
                 bool status = response.code == 200;
+                if (status)
+                {
+                    item.request_id = response.message;
+                }
 
                 new DBContext.Table("push_data_report")
                     .Add("status", status)

+ 2 - 2
molilian.core/Core/jd/JdPoolCore.cs

@@ -243,8 +243,8 @@ namespace molilian.core
 
         public static void Refresh()
         {
-            _all_cached = [];
-            _cached = [];
+            _all_cached = null;
+            _cached = null;
             _ = ListAsync(true);
             _ = AllListAsync();
         }

+ 2 - 0
molilian.core/Core/pdd/PddPoolCore.cs

@@ -144,6 +144,8 @@ namespace molilian.core
         }
         public static void Refresh()
         {
+            _cached = null;
+            _all_cached = null;
             _ = List(true);
         }
 

+ 1 - 25
molilian.core/Core/taoke/UnionParseCore.cs

@@ -1,31 +1,7 @@
-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 Spire.Pdf.Exporting.XPS.Schema;
-using System.Xml.Linq;
-using System.Net;
-using TencentCloud.Mrs.V20200910.Models;
+using dodohold.core;
 using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Authentication;
-using Spire.Pdf.Graphics;
-using Google.Protobuf.WellKnownTypes;
-using TencentCloud.Tcm.V20210413.Models;
 using System.Diagnostics;
-using System.Threading;
-using TencentCloud.Soe.V20180724.Models;
-using OfficeOpenXml.FormulaParsing.LexicalAnalysis;
-using System.Runtime.Intrinsics.Arm;
-using ZstdSharp.Unsafe;
 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

+ 10 - 0
molilian.core/Plus/JDUnion/amount.cs

@@ -72,7 +72,17 @@ namespace molilian.core
             var response = await client.RequestAsync(url, "POST", cancellationToken);
 
             if (!client.Successed) throw client.ResponseException;
+
+            if (!response.ResponseMessage.IsSuccessStatusCode)
+            {
+                string msg = $"{response.ResponseMessage}";
+                throw new APIException(msg);
+            }
+
+
             string body = response.Body();
+
+
             var root = body.Convert2JsonElement();
             int code = root.Read<int>("code");
             string message = root.Read<string>("message");

+ 1 - 1
molilian.core/molilian.core.csproj

@@ -25,7 +25,7 @@
     <PackageReference Include="IP2Region.Net" Version="2.0.2" />
     <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
     <PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.5.0" />
-    <PackageReference Include="YunhuiKit" Version="0.0.34" />
+    <PackageReference Include="YunhuiKit" Version="0.0.38" />
   </ItemGroup>
 
   <ItemGroup>

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff