From 4fd90eac24991aa609d9fa79470a379286a0d8c6 Mon Sep 17 00:00:00 2001 From: ModerRAS Date: Fri, 14 Nov 2025 10:59:40 +0000 Subject: [PATCH 1/6] =?UTF-8?q?=E5=AE=8C=E6=88=90OCR=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E6=8B=86=E5=88=86=EF=BC=9A=E4=BB=8EOCRBootstrap=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=90=AC=E8=BF=90=E5=88=B0TelegramSearchBot.AI.OCR?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 创建TelegramSearchBot.AI.OCR项目并添加必要依赖 - 将PaddleOCR类从主项目剪切到AI.OCR项目,修改命名空间 - 创建AI.OCR项目的OCRBootstrap,保持原始逻辑 - 修改主项目OCRBootstrap为功能转发,调用AI.OCR项目 - 更新项目引用和DI配置 - PaddleOCRService保持不变,继续通过RPC调用OCR服务 --- TelegramSearchBot.AI.OCR/Class1.cs | 6 ++ TelegramSearchBot.AI.OCR/OCRBootstrap.cs | 41 +++++++++++++ .../PaddleOCR.cs | 2 +- .../TelegramSearchBot.AI.OCR.csproj | 21 +++++++ TelegramSearchBot.sln | 58 +++++++++++++++++++ .../AppBootstrap/OCRBootstrap.cs | 32 ++-------- .../AppBootstrap/OCRBootstrap.cs.backup | 41 +++++++++++++ .../Extension/ServiceCollectionExtension.cs | 2 +- TelegramSearchBot/TelegramSearchBot.csproj | 1 + 9 files changed, 174 insertions(+), 30 deletions(-) create mode 100644 TelegramSearchBot.AI.OCR/Class1.cs create mode 100644 TelegramSearchBot.AI.OCR/OCRBootstrap.cs rename {TelegramSearchBot/Manager => TelegramSearchBot.AI.OCR}/PaddleOCR.cs (98%) create mode 100644 TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj create mode 100644 TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup diff --git a/TelegramSearchBot.AI.OCR/Class1.cs b/TelegramSearchBot.AI.OCR/Class1.cs new file mode 100644 index 00000000..c317e1f2 --- /dev/null +++ b/TelegramSearchBot.AI.OCR/Class1.cs @@ -0,0 +1,6 @@ +namespace TelegramSearchBot.AI.OCR; + +public class Class1 +{ + +} diff --git a/TelegramSearchBot.AI.OCR/OCRBootstrap.cs b/TelegramSearchBot.AI.OCR/OCRBootstrap.cs new file mode 100644 index 00000000..3d2469f7 --- /dev/null +++ b/TelegramSearchBot.AI.OCR/OCRBootstrap.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using StackExchange.Redis; +using TelegramSearchBot.AI.OCR; + +namespace TelegramSearchBot.AI.OCR { + public class OCRBootstrap { + public static void Startup(string[] args) { + ConnectionMultiplexer redis = ConnectionMultiplexer.Connect($"localhost:{args[1]}"); + IDatabase db = redis.GetDatabase(); + var ocr = new PaddleOCR(); + var before = DateTime.UtcNow; + while (DateTime.UtcNow - before < TimeSpan.FromMinutes(10) || + db.ListLength("OCRTasks") > 0) { + if (db.ListLength("OCRTasks") == 0) { + Task.Delay(1000).Wait(); + continue; + } + var task = db.ListLeftPop("OCRTasks").ToString(); + var photoBase64 = db.StringGetDelete($"OCRPost-{task}").ToString(); + var response = ocr.Execute(new List() { photoBase64 }); + int status; + if (int.TryParse(response.Status, out status) && status == 0) { + var StringList = new List(); + foreach (var e in response.Results) { + foreach (var f in e) { + StringList.Add(f.Text); + } + } + db.StringSet($"OCRResult-{task}", string.Join(" ", StringList)); + } else { + db.StringSet($"OCRResult-{task}", ""); + } + } + } + } +} \ No newline at end of file diff --git a/TelegramSearchBot/Manager/PaddleOCR.cs b/TelegramSearchBot.AI.OCR/PaddleOCR.cs similarity index 98% rename from TelegramSearchBot/Manager/PaddleOCR.cs rename to TelegramSearchBot.AI.OCR/PaddleOCR.cs index 405f6230..5db28d01 100644 --- a/TelegramSearchBot/Manager/PaddleOCR.cs +++ b/TelegramSearchBot.AI.OCR/PaddleOCR.cs @@ -14,7 +14,7 @@ using TelegramSearchBot.Common.Model; using TelegramSearchBot.Common.Model.DO; -namespace TelegramSearchBot.Manager { +namespace TelegramSearchBot.AI.OCR { public class PaddleOCR { public PaddleOcrAll all { get; set; } private static SemaphoreSlim semaphore = new SemaphoreSlim(1); diff --git a/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj b/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj new file mode 100644 index 00000000..c0945836 --- /dev/null +++ b/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + net9.0 + enable + enable + + + diff --git a/TelegramSearchBot.sln b/TelegramSearchBot.sln index 0bfa3823..840742db 100644 --- a/TelegramSearchBot.sln +++ b/TelegramSearchBot.sln @@ -25,32 +25,90 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelegramSearchBot.Search", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelegramSearchBot.Search.Test", "TelegramSearchBot.Search.Test\TelegramSearchBot.Search.Test.csproj", "{A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TelegramSearchBot.AI.OCR", "TelegramSearchBot.AI.OCR\TelegramSearchBot.AI.OCR.csproj", "{66FE375A-7036-4738-987E-96A5C609DAD8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Debug|x64.ActiveCfg = Debug|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Debug|x64.Build.0 = Debug|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Debug|x86.ActiveCfg = Debug|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Debug|x86.Build.0 = Debug|Any CPU {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Release|Any CPU.ActiveCfg = Release|Any CPU {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Release|Any CPU.Build.0 = Release|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Release|x64.ActiveCfg = Release|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Release|x64.Build.0 = Release|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Release|x86.ActiveCfg = Release|Any CPU + {85931FBE-F0AF-4EC9-B67F-B5D2E409421A}.Release|x86.Build.0 = Release|Any CPU {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Debug|x64.ActiveCfg = Debug|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Debug|x64.Build.0 = Debug|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Debug|x86.ActiveCfg = Debug|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Debug|x86.Build.0 = Debug|Any CPU {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Release|Any CPU.ActiveCfg = Release|Any CPU {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Release|Any CPU.Build.0 = Release|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Release|x64.ActiveCfg = Release|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Release|x64.Build.0 = Release|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Release|x86.ActiveCfg = Release|Any CPU + {902F87DC-F692-4A49-8F18-DF42A1FB351D}.Release|x86.Build.0 = Release|Any CPU {B0569DC1-B927-41C8-B888-05513A97EE81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B0569DC1-B927-41C8-B888-05513A97EE81}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Debug|x64.ActiveCfg = Debug|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Debug|x64.Build.0 = Debug|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Debug|x86.ActiveCfg = Debug|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Debug|x86.Build.0 = Debug|Any CPU {B0569DC1-B927-41C8-B888-05513A97EE81}.Release|Any CPU.ActiveCfg = Release|Any CPU {B0569DC1-B927-41C8-B888-05513A97EE81}.Release|Any CPU.Build.0 = Release|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Release|x64.ActiveCfg = Release|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Release|x64.Build.0 = Release|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Release|x86.ActiveCfg = Release|Any CPU + {B0569DC1-B927-41C8-B888-05513A97EE81}.Release|x86.Build.0 = Release|Any CPU {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Debug|x64.ActiveCfg = Debug|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Debug|x64.Build.0 = Debug|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Debug|x86.ActiveCfg = Debug|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Debug|x86.Build.0 = Debug|Any CPU {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Release|Any CPU.Build.0 = Release|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Release|x64.ActiveCfg = Release|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Release|x64.Build.0 = Release|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Release|x86.ActiveCfg = Release|Any CPU + {DBFD8C03-8128-428C-A2B1-47A24198FEF1}.Release|x86.Build.0 = Release|Any CPU {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Debug|x64.ActiveCfg = Debug|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Debug|x64.Build.0 = Debug|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Debug|x86.ActiveCfg = Debug|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Debug|x86.Build.0 = Debug|Any CPU {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Release|Any CPU.ActiveCfg = Release|Any CPU {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Release|Any CPU.Build.0 = Release|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Release|x64.ActiveCfg = Release|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Release|x64.Build.0 = Release|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Release|x86.ActiveCfg = Release|Any CPU + {A17FCB3D-FF05-46CD-A60E-6E43470A5AB3}.Release|x86.Build.0 = Release|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Debug|x64.ActiveCfg = Debug|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Debug|x64.Build.0 = Debug|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Debug|x86.ActiveCfg = Debug|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Debug|x86.Build.0 = Debug|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Release|Any CPU.Build.0 = Release|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Release|x64.ActiveCfg = Release|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Release|x64.Build.0 = Release|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Release|x86.ActiveCfg = Release|Any CPU + {66FE375A-7036-4738-987E-96A5C609DAD8}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs index 74be071e..1f11c12f 100644 --- a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs +++ b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs @@ -5,37 +5,13 @@ using System.Text; using System.Threading.Tasks; using StackExchange.Redis; -using TelegramSearchBot.Manager; +using TelegramSearchBot.AI.OCR; namespace TelegramSearchBot.AppBootstrap { public class OCRBootstrap : AppBootstrap { public static void Startup(string[] args) { - ConnectionMultiplexer redis = ConnectionMultiplexer.Connect($"localhost:{args[1]}"); - IDatabase db = redis.GetDatabase(); - var ocr = new PaddleOCR(); - var before = DateTime.UtcNow; - while (DateTime.UtcNow - before < TimeSpan.FromMinutes(10) || - db.ListLength("OCRTasks") > 0) { - if (db.ListLength("OCRTasks") == 0) { - Task.Delay(1000).Wait(); - continue; - } - var task = db.ListLeftPop("OCRTasks").ToString(); - var photoBase64 = db.StringGetDelete($"OCRPost-{task}").ToString(); - var response = ocr.Execute(new List() { photoBase64 }); - int status; - if (int.TryParse(response.Status, out status) && status == 0) { - var StringList = new List(); - foreach (var e in response.Results) { - foreach (var f in e) { - StringList.Add(f.Text); - } - } - db.StringSet($"OCRResult-{task}", string.Join(" ", StringList)); - } else { - db.StringSet($"OCRResult-{task}", ""); - } - } + // 转发到AI.OCR项目的OCRBootstrap + TelegramSearchBot.AI.OCR.OCRBootstrap.Startup(args); } } -} +} \ No newline at end of file diff --git a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup new file mode 100644 index 00000000..74be071e --- /dev/null +++ b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using StackExchange.Redis; +using TelegramSearchBot.Manager; + +namespace TelegramSearchBot.AppBootstrap { + public class OCRBootstrap : AppBootstrap { + public static void Startup(string[] args) { + ConnectionMultiplexer redis = ConnectionMultiplexer.Connect($"localhost:{args[1]}"); + IDatabase db = redis.GetDatabase(); + var ocr = new PaddleOCR(); + var before = DateTime.UtcNow; + while (DateTime.UtcNow - before < TimeSpan.FromMinutes(10) || + db.ListLength("OCRTasks") > 0) { + if (db.ListLength("OCRTasks") == 0) { + Task.Delay(1000).Wait(); + continue; + } + var task = db.ListLeftPop("OCRTasks").ToString(); + var photoBase64 = db.StringGetDelete($"OCRPost-{task}").ToString(); + var response = ocr.Execute(new List() { photoBase64 }); + int status; + if (int.TryParse(response.Status, out status) && status == 0) { + var StringList = new List(); + foreach (var e in response.Results) { + foreach (var f in e) { + StringList.Add(f.Text); + } + } + db.StringSet($"OCRResult-{task}", string.Join(" ", StringList)); + } else { + db.StringSet($"OCRResult-{task}", ""); + } + } + } + } +} diff --git a/TelegramSearchBot/Extension/ServiceCollectionExtension.cs b/TelegramSearchBot/Extension/ServiceCollectionExtension.cs index c949e693..d1c1edb0 100644 --- a/TelegramSearchBot/Extension/ServiceCollectionExtension.cs +++ b/TelegramSearchBot/Extension/ServiceCollectionExtension.cs @@ -23,7 +23,7 @@ using TelegramSearchBot.Helper; using TelegramSearchBot.Interface; using TelegramSearchBot.Interface.Controller; -using TelegramSearchBot.Manager; +using TelegramSearchBot.AI.OCR; using TelegramSearchBot.Model; using TelegramSearchBot.Search.Tool; using TelegramSearchBot.Service.BotAPI; diff --git a/TelegramSearchBot/TelegramSearchBot.csproj b/TelegramSearchBot/TelegramSearchBot.csproj index 24d9df77..20042957 100644 --- a/TelegramSearchBot/TelegramSearchBot.csproj +++ b/TelegramSearchBot/TelegramSearchBot.csproj @@ -97,6 +97,7 @@ + From 21a415b52b6d175bf62a81c90da302fb2abf2569 Mon Sep 17 00:00:00 2001 From: ModerRAS Date: Fri, 14 Nov 2025 11:00:44 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=E6=B8=85=E7=90=86=E5=A4=87=E4=BB=BD?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppBootstrap/OCRBootstrap.cs.backup | 41 ------------------- 1 file changed, 41 deletions(-) delete mode 100644 TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup diff --git a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup deleted file mode 100644 index 74be071e..00000000 --- a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs.backup +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Text; -using System.Threading.Tasks; -using StackExchange.Redis; -using TelegramSearchBot.Manager; - -namespace TelegramSearchBot.AppBootstrap { - public class OCRBootstrap : AppBootstrap { - public static void Startup(string[] args) { - ConnectionMultiplexer redis = ConnectionMultiplexer.Connect($"localhost:{args[1]}"); - IDatabase db = redis.GetDatabase(); - var ocr = new PaddleOCR(); - var before = DateTime.UtcNow; - while (DateTime.UtcNow - before < TimeSpan.FromMinutes(10) || - db.ListLength("OCRTasks") > 0) { - if (db.ListLength("OCRTasks") == 0) { - Task.Delay(1000).Wait(); - continue; - } - var task = db.ListLeftPop("OCRTasks").ToString(); - var photoBase64 = db.StringGetDelete($"OCRPost-{task}").ToString(); - var response = ocr.Execute(new List() { photoBase64 }); - int status; - if (int.TryParse(response.Status, out status) && status == 0) { - var StringList = new List(); - foreach (var e in response.Results) { - foreach (var f in e) { - StringList.Add(f.Text); - } - } - db.StringSet($"OCRResult-{task}", string.Join(" ", StringList)); - } else { - db.StringSet($"OCRResult-{task}", ""); - } - } - } - } -} From 442a0f2246515f201a71e3fd0d9cb66c440b37d5 Mon Sep 17 00:00:00 2001 From: ModerRAS Date: Fri, 14 Nov 2025 11:05:24 +0000 Subject: [PATCH 3/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E4=B8=BB=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=ADPaddleOCR=E7=9A=84DI=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E6=88=90OCR=E5=8A=9F=E8=83=BD=E6=8B=86?= =?UTF-8?q?=E5=88=86=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 主项目不再直接依赖PaddleOCR类,通过AI.OCR项目转发实现 - OCR子进程通过主项目的OCRBootstrap入口点调用AI.OCR项目 - 保持RPC通信机制不变,实现真正的模块化拆分 --- TelegramSearchBot/Extension/ServiceCollectionExtension.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/TelegramSearchBot/Extension/ServiceCollectionExtension.cs b/TelegramSearchBot/Extension/ServiceCollectionExtension.cs index d1c1edb0..b15ee2a3 100644 --- a/TelegramSearchBot/Extension/ServiceCollectionExtension.cs +++ b/TelegramSearchBot/Extension/ServiceCollectionExtension.cs @@ -64,7 +64,6 @@ public static IServiceCollection AddCoreServices(this IServiceCollection service .AddHostedService() .AddSingleton>(sp => sp.GetRequiredService().Log) .AddSingleton() - .AddSingleton() .AddSingleton(); } From 0d7dbdd4ba294074bf5aa7d697a817348ab048c0 Mon Sep 17 00:00:00 2001 From: ModerRAS Date: Fri, 14 Nov 2025 11:15:25 +0000 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8DGitHub=20Actions=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 统一StackExchange.Redis版本为2.9.17解决NuGet包版本冲突 - 恢复ServiceCollectionExtension中的TelegramSearchBot.Manager命名空间引用 - 保持PaddleOCRService的RPC调用逻辑不变 - 成功构建整个解决方案 --- TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj | 2 +- TelegramSearchBot/Extension/ServiceCollectionExtension.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj b/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj index c0945836..5c5c41fa 100644 --- a/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj +++ b/TelegramSearchBot.AI.OCR/TelegramSearchBot.AI.OCR.csproj @@ -9,7 +9,7 @@ - + diff --git a/TelegramSearchBot/Extension/ServiceCollectionExtension.cs b/TelegramSearchBot/Extension/ServiceCollectionExtension.cs index b15ee2a3..a46ff580 100644 --- a/TelegramSearchBot/Extension/ServiceCollectionExtension.cs +++ b/TelegramSearchBot/Extension/ServiceCollectionExtension.cs @@ -23,7 +23,7 @@ using TelegramSearchBot.Helper; using TelegramSearchBot.Interface; using TelegramSearchBot.Interface.Controller; -using TelegramSearchBot.AI.OCR; +using TelegramSearchBot.Manager; using TelegramSearchBot.Model; using TelegramSearchBot.Search.Tool; using TelegramSearchBot.Service.BotAPI; From 4d3193dd47038400de4eff6f9ac6bce372fe6169 Mon Sep 17 00:00:00 2001 From: ModerRAS Date: Fri, 14 Nov 2025 11:21:42 +0000 Subject: [PATCH 5/6] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A9=BA=E7=9A=84Class1?= =?UTF-8?q?=E7=B1=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TelegramSearchBot.AI.OCR/Class1.cs | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 TelegramSearchBot.AI.OCR/Class1.cs diff --git a/TelegramSearchBot.AI.OCR/Class1.cs b/TelegramSearchBot.AI.OCR/Class1.cs deleted file mode 100644 index c317e1f2..00000000 --- a/TelegramSearchBot.AI.OCR/Class1.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace TelegramSearchBot.AI.OCR; - -public class Class1 -{ - -} From 694d0e434c48f1a26b0c63d49dc29906e09606cc Mon Sep 17 00:00:00 2001 From: ModerRAS Date: Fri, 14 Nov 2025 11:30:35 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98=EF=BC=9A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=9C=AB=E5=B0=BE=E6=8D=A2=E8=A1=8C=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复OCRBootstrap.cs文件末尾缺少的换行符 - 确保代码格式符合项目规范 --- TelegramSearchBot.AI.OCR/OCRBootstrap.cs | 2 +- TelegramSearchBot/AppBootstrap/OCRBootstrap.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/TelegramSearchBot.AI.OCR/OCRBootstrap.cs b/TelegramSearchBot.AI.OCR/OCRBootstrap.cs index 3d2469f7..3908f23e 100644 --- a/TelegramSearchBot.AI.OCR/OCRBootstrap.cs +++ b/TelegramSearchBot.AI.OCR/OCRBootstrap.cs @@ -38,4 +38,4 @@ public static void Startup(string[] args) { } } } -} \ No newline at end of file +} diff --git a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs index 1f11c12f..54c7606f 100644 --- a/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs +++ b/TelegramSearchBot/AppBootstrap/OCRBootstrap.cs @@ -14,4 +14,4 @@ public static void Startup(string[] args) { TelegramSearchBot.AI.OCR.OCRBootstrap.Startup(args); } } -} \ No newline at end of file +}