|
@@ -97,7 +97,7 @@ namespace TEAMModelOS.SDK.Models.Service.BI
|
|
|
/// <param name="path">防火墙路径</param>
|
|
|
/// <param name="connectStr">连接字串</param>
|
|
|
/// <returns></returns>
|
|
|
- public static async Task<(List<RecCnt> recCnts, List<string> saveUrls)> GetPathAnalyse(AzureStorageFactory _azureStorage, IPSearcher _ipSearcher, DingDing _dingDing, string path, string connectName, string timeType = "Hour")
|
|
|
+ public static async Task<(List<RecCnt> recCnts, List<string> saveUrls)> GetPathAnalyse(AzureStorageFactory _azureStorage, DingDing _dingDing, string path, string connectName, string timeType = "Hour")
|
|
|
{
|
|
|
List<RecCnt> recCnts = new();
|
|
|
List<string> urls = new();
|
|
@@ -199,37 +199,37 @@ namespace TEAMModelOS.SDK.Models.Service.BI
|
|
|
|
|
|
var ipcounts = saveCnts.ipCnt.Select(z => new IdCodeCount { id = z.ip, count = z.count }).ToList();
|
|
|
ipcounts.ForEach(async x => {
|
|
|
- string region = await _ipSearcher.SearchIpAsync(x.id);
|
|
|
- if (!string.IsNullOrWhiteSpace(region))
|
|
|
- {
|
|
|
- string[] dis = region.Split("·");
|
|
|
- if (dis.Length >= 2)
|
|
|
- {
|
|
|
- x.code = dis[dis.Length - 1];
|
|
|
- x.name = dis[dis.Length - 2]; // 不保留省份
|
|
|
- //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var disrs = Regex.Split(region.TrimStart().TrimEnd(), @"\s+");
|
|
|
- if (disrs.Length >= 2)
|
|
|
- {
|
|
|
- x.code = disrs[disrs.Length - 1];
|
|
|
- x.name = disrs[disrs.Length - 2]; //不保留省份
|
|
|
- //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- x.code = region;
|
|
|
- x.name = region;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- x.name = x.id;
|
|
|
- x.code = x.id;
|
|
|
- }
|
|
|
+ //string region = await _ipSearcher.SearchIpAsync(x.id);
|
|
|
+ //if (!string.IsNullOrWhiteSpace(region))
|
|
|
+ //{
|
|
|
+ // string[] dis = region.Split("·");
|
|
|
+ // if (dis.Length >= 2)
|
|
|
+ // {
|
|
|
+ // x.code = dis[dis.Length - 1];
|
|
|
+ // x.name = dis[dis.Length - 2]; // 不保留省份
|
|
|
+ // //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // var disrs = Regex.Split(region.TrimStart().TrimEnd(), @"\s+");
|
|
|
+ // if (disrs.Length >= 2)
|
|
|
+ // {
|
|
|
+ // x.code = disrs[disrs.Length - 1];
|
|
|
+ // x.name = disrs[disrs.Length - 2]; //不保留省份
|
|
|
+ // //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // x.code = region;
|
|
|
+ // x.name = region;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // x.name = x.id;
|
|
|
+ // x.code = x.id;
|
|
|
+ //}
|
|
|
});
|
|
|
List<RecRegionCnt> regionCnts = new();
|
|
|
ipcounts.GroupBy(x => x.name).ToList().ForEach(z => {
|
|
@@ -265,37 +265,37 @@ namespace TEAMModelOS.SDK.Models.Service.BI
|
|
|
|
|
|
var ipcounts = dayIpCnt.Select(z => new IdCodeCount { id = z.ip, count = z.count }).ToList();
|
|
|
ipcounts.ForEach(async x => {
|
|
|
- string region = await _ipSearcher.SearchIpAsync(x.id);
|
|
|
- if (!string.IsNullOrWhiteSpace(region))
|
|
|
- {
|
|
|
- string[] dis = region.Split("·");
|
|
|
- if (dis.Length >= 2)
|
|
|
- {
|
|
|
- x.code = dis[dis.Length - 1];
|
|
|
- x.name = dis[dis.Length - 2]; // 不保留省份
|
|
|
- //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- var disrs = Regex.Split(region.TrimStart().TrimEnd(), @"\s+");
|
|
|
- if (disrs.Length >= 2)
|
|
|
- {
|
|
|
- x.code = disrs[disrs.Length - 1];
|
|
|
- x.name = disrs[disrs.Length - 2]; //不保留省份
|
|
|
- //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- x.code = region;
|
|
|
- x.name = region;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- x.name = x.id;
|
|
|
- x.code = x.id;
|
|
|
- }
|
|
|
+ //string region = await _ipSearcher.SearchIpAsync(x.id);
|
|
|
+ //if (!string.IsNullOrWhiteSpace(region))
|
|
|
+ //{
|
|
|
+ // string[] dis = region.Split("·");
|
|
|
+ // if (dis.Length >= 2)
|
|
|
+ // {
|
|
|
+ // x.code = dis[dis.Length - 1];
|
|
|
+ // x.name = dis[dis.Length - 2]; // 不保留省份
|
|
|
+ // //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // var disrs = Regex.Split(region.TrimStart().TrimEnd(), @"\s+");
|
|
|
+ // if (disrs.Length >= 2)
|
|
|
+ // {
|
|
|
+ // x.code = disrs[disrs.Length - 1];
|
|
|
+ // x.name = disrs[disrs.Length - 2]; //不保留省份
|
|
|
+ // //x.name = region.Substring(0, region.LastIndexOf("·")); //保留省份
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // x.code = region;
|
|
|
+ // x.name = region;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //else
|
|
|
+ //{
|
|
|
+ // x.name = x.id;
|
|
|
+ // x.code = x.id;
|
|
|
+ //}
|
|
|
});
|
|
|
List<RecRegionCnt> regionCnts = new();
|
|
|
ipcounts.GroupBy(x => x.name).ToList().ForEach(z => {
|