diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 87fab940c..a170a150f 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -25,6 +25,8 @@ using Microsoft.AspNetCore.HttpOverrides; using IRaCIS.Application.Services.BackGroundJob; using LogDashboard; using OfficeOpenXml.Utils; +using IP2Region.Net.Abstractions; +using IP2Region.Net.XDB; @@ -179,6 +181,7 @@ builder.Services.AddSingleton(); //services.AddAuthorizationPolicySetup(_configuration); #endregion +builder.Services.AddSingleton(new Searcher(CachePolicy.Content, Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "ip2region.xdb"))); #endregion var app = builder.Build(); diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj index 797baa8aa..b45fd97fa 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj @@ -108,4 +108,10 @@ + + + Always + + + diff --git a/IRaCIS.Core.Application/Resources/ip2region.xdb b/IRaCIS.Core.Application/Resources/ip2region.xdb new file mode 100644 index 000000000..7052c0571 Binary files /dev/null and b/IRaCIS.Core.Application/Resources/ip2region.xdb differ