懒得勤快 преди 3 години
родител
ревизия
ae6aaf4e74
променени са 100 файла, в които са добавени 55 реда и са изтрити 389 реда
  1. 9 9
      src/Masuit.MyBlogs.Core/Common/CommonHelper.cs
  2. 1 2
      src/Masuit.MyBlogs.Core/Common/HangfireHelper.cs
  3. 1 4
      src/Masuit.MyBlogs.Core/Common/HttpContextExtension.cs
  4. 5 38
      src/Masuit.MyBlogs.Core/Common/ImagebedClient.cs
  5. 5 4
      src/Masuit.MyBlogs.Core/Common/Mails/IMailSender.cs
  6. 3 5
      src/Masuit.MyBlogs.Core/Common/Mails/MailServiceCollectionExt.cs
  7. 1 6
      src/Masuit.MyBlogs.Core/Common/Mails/MailgunSender.cs
  8. 1 5
      src/Masuit.MyBlogs.Core/Common/Mails/SmtpSender.cs
  9. 0 3
      src/Masuit.MyBlogs.Core/Common/PerfCounter.cs
  10. 0 4
      src/Masuit.MyBlogs.Core/Common/TrackData.cs
  11. 0 3
      src/Masuit.MyBlogs.Core/Common/UserAgent.cs
  12. 1 3
      src/Masuit.MyBlogs.Core/Configs/AppConfig.cs
  13. 0 1
      src/Masuit.MyBlogs.Core/Configs/HangfireJobInit.cs
  14. 0 4
      src/Masuit.MyBlogs.Core/Controllers/AdminController.cs
  15. 0 5
      src/Masuit.MyBlogs.Core/Controllers/BaseController.cs
  16. 0 2
      src/Masuit.MyBlogs.Core/Controllers/CategoryController.cs
  17. 0 7
      src/Masuit.MyBlogs.Core/Controllers/CommentController.cs
  18. 0 4
      src/Masuit.MyBlogs.Core/Controllers/DashboardController.cs
  19. 0 1
      src/Masuit.MyBlogs.Core/Controllers/DonateController.cs
  20. 0 4
      src/Masuit.MyBlogs.Core/Controllers/Drive/AdminController.cs
  21. 10 10
      src/Masuit.MyBlogs.Core/Controllers/Drive/SitesController.cs
  22. 0 2
      src/Masuit.MyBlogs.Core/Controllers/Drive/UserController.cs
  23. 0 5
      src/Masuit.MyBlogs.Core/Controllers/ErrorController.cs
  24. 0 2
      src/Masuit.MyBlogs.Core/Controllers/FirewallController.cs
  25. 0 7
      src/Masuit.MyBlogs.Core/Controllers/HomeController.cs
  26. 0 7
      src/Masuit.MyBlogs.Core/Controllers/LinksController.cs
  27. 0 2
      src/Masuit.MyBlogs.Core/Controllers/LoginController.cs
  28. 0 4
      src/Masuit.MyBlogs.Core/Controllers/MenuController.cs
  29. 0 5
      src/Masuit.MyBlogs.Core/Controllers/MergeController.cs
  30. 0 6
      src/Masuit.MyBlogs.Core/Controllers/MiscController.cs
  31. 0 7
      src/Masuit.MyBlogs.Core/Controllers/MsgController.cs
  32. 1 5
      src/Masuit.MyBlogs.Core/Controllers/NoticeController.cs
  33. 0 2
      src/Masuit.MyBlogs.Core/Controllers/PassportController.cs
  34. 0 8
      src/Masuit.MyBlogs.Core/Controllers/PostController.cs
  35. 0 4
      src/Masuit.MyBlogs.Core/Controllers/SearchController.cs
  36. 0 3
      src/Masuit.MyBlogs.Core/Controllers/SeminarController.cs
  37. 0 2
      src/Masuit.MyBlogs.Core/Controllers/ShareController.cs
  38. 0 4
      src/Masuit.MyBlogs.Core/Controllers/SubscribeController.cs
  39. 0 5
      src/Masuit.MyBlogs.Core/Controllers/SystemController.cs
  40. 0 6
      src/Masuit.MyBlogs.Core/Controllers/ToolsController.cs
  41. 1 8
      src/Masuit.MyBlogs.Core/Controllers/UploadController.cs
  42. 0 2
      src/Masuit.MyBlogs.Core/Controllers/UserController.cs
  43. 0 1
      src/Masuit.MyBlogs.Core/Controllers/ValidateController.cs
  44. 0 1
      src/Masuit.MyBlogs.Core/Controllers/ValuesController.cs
  45. 0 3
      src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/OneDriveConfiguration.cs
  46. 0 4
      src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/ProtectedApiCallHelper.cs
  47. 0 1
      src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/ServiceCollectionExtension.cs
  48. 0 1
      src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/TokenCacheHelper.cs
  49. 1 3
      src/Masuit.MyBlogs.Core/Extensions/Firewall/AccessDenyException.cs
  50. 0 1
      src/Masuit.MyBlogs.Core/Extensions/Firewall/AllowAccessFirewallAttribute.cs
  51. 0 4
      src/Masuit.MyBlogs.Core/Extensions/Firewall/CloudflareRepoter.cs
  52. 0 1
      src/Masuit.MyBlogs.Core/Extensions/Firewall/DefaultFirewallRepoter.cs
  53. 0 3
      src/Masuit.MyBlogs.Core/Extensions/Firewall/FirewallAttribute.cs
  54. 1 4
      src/Masuit.MyBlogs.Core/Extensions/Firewall/FirewallServiceCollectionExt.cs
  55. 0 1
      src/Masuit.MyBlogs.Core/Extensions/Firewall/IFirewallRepoter.cs
  56. 1 3
      src/Masuit.MyBlogs.Core/Extensions/Firewall/IpIntercepter.cs
  57. 0 4
      src/Masuit.MyBlogs.Core/Extensions/Firewall/RequestInterceptMiddleware.cs
  58. 1 3
      src/Masuit.MyBlogs.Core/Extensions/Firewall/TempDenyException.cs
  59. 0 4
      src/Masuit.MyBlogs.Core/Extensions/MyAuthorizeAttribute.cs
  60. 1 3
      src/Masuit.MyBlogs.Core/Extensions/NotFoundException.cs
  61. 0 3
      src/Masuit.MyBlogs.Core/Extensions/TranslateMiddleware.cs
  62. 1 4
      src/Masuit.MyBlogs.Core/Extensions/UEditor/ConfigHandler.cs
  63. 0 7
      src/Masuit.MyBlogs.Core/Extensions/UEditor/CrawlerHandler.cs
  64. 1 3
      src/Masuit.MyBlogs.Core/Extensions/UEditor/Handler.cs
  65. 1 8
      src/Masuit.MyBlogs.Core/Extensions/UEditor/ListFileManager.cs
  66. 1 4
      src/Masuit.MyBlogs.Core/Extensions/UEditor/NotSupportedHandler.cs
  67. 0 2
      src/Masuit.MyBlogs.Core/Extensions/UEditor/PathFormatter.cs
  68. 0 3
      src/Masuit.MyBlogs.Core/Extensions/UEditor/UeditorConfig.cs
  69. 0 7
      src/Masuit.MyBlogs.Core/Extensions/UEditor/UploadHandler.cs
  70. 0 5
      src/Masuit.MyBlogs.Core/Infrastructure/Drive/DriveAccountService.cs
  71. 0 6
      src/Masuit.MyBlogs.Core/Infrastructure/Drive/DriveService.cs
  72. 0 3
      src/Masuit.MyBlogs.Core/Infrastructure/Drive/IDriveAccountService.cs
  73. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Drive/IDriveService.cs
  74. 0 3
      src/Masuit.MyBlogs.Core/Infrastructure/Drive/SettingService.cs
  75. 0 5
      src/Masuit.MyBlogs.Core/Infrastructure/Drive/TokenService.cs
  76. 0 1
      src/Masuit.MyBlogs.Core/Infrastructure/DriveContext.cs
  77. 0 4
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/BaseRepository.cs
  78. 0 3
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/CommentRepository.cs
  79. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/Interface/ISearchDetailsRepository.cs
  80. 0 3
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/LeaveMessageRepository.cs
  81. 0 3
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/MenuRepository.cs
  82. 0 4
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/PostRepository.cs
  83. 0 3
      src/Masuit.MyBlogs.Core/Infrastructure/Repository/SearchDetailsRepository.cs
  84. 0 4
      src/Masuit.MyBlogs.Core/Infrastructure/Services/BaseService.cs
  85. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Services/CategoryService.cs
  86. 0 1
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IAdvertisementService.cs
  87. 0 4
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IBaseService.cs
  88. 0 1
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/ICategoryService.cs
  89. 0 1
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IMenuService.cs
  90. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IPostService.cs
  91. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/ISearchDetailsService.cs
  92. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Services/MenuService.cs
  93. 1 2
      src/Masuit.MyBlogs.Core/Infrastructure/Services/PostService.cs
  94. 0 2
      src/Masuit.MyBlogs.Core/Infrastructure/Services/SearchDetailsService.cs
  95. 0 1
      src/Masuit.MyBlogs.Core/Infrastructure/Services/UserInfoService.cs
  96. 4 4
      src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj
  97. 0 1
      src/Masuit.MyBlogs.Core/Models/Command/SearchDetailsCommand.cs
  98. 0 1
      src/Masuit.MyBlogs.Core/Models/DTO/AdvertisementDto.cs
  99. 1 3
      src/Masuit.MyBlogs.Core/Models/DTO/CommentDto.cs
  100. 1 3
      src/Masuit.MyBlogs.Core/Models/DTO/DonateDto.cs

+ 9 - 9
src/Masuit.MyBlogs.Core/Common/CommonHelper.cs

@@ -12,20 +12,12 @@ using MaxMind.GeoIP2;
 using MaxMind.GeoIP2.Exceptions;
 using MaxMind.GeoIP2.Model;
 using MaxMind.GeoIP2.Responses;
-using Microsoft.Extensions.DependencyInjection;
 using Polly;
-using System;
 using System.Collections.Concurrent;
-using System.Collections.Generic;
 using System.Drawing;
-using System.IO;
-using System.Linq;
 using System.Net;
-using System.Net.Http;
 using System.Net.Sockets;
 using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
 using TimeZoneConverter;
 
 namespace Masuit.MyBlogs.Core.Common
@@ -417,13 +409,21 @@ namespace Masuit.MyBlogs.Core.Common
         }
 
         public string Country { get; set; }
+
         public string Province { get; set; }
+
         public string City { get; set; }
+
         public string ISP { get; set; }
+
         public long? ASN { get; set; }
+
         public string Address => new[] { Country, Province, City }.Where(s => !string.IsNullOrEmpty(s)).Distinct().Join("");
+
         public string Address2 { get; set; }
+
         public string Network => ASN.HasValue ? ISP + "(AS" + ASN + ")" : ISP;
+
         public Location Coodinate { get; set; }
 
         public override string ToString()
@@ -460,4 +460,4 @@ namespace Masuit.MyBlogs.Core.Common
             return ToString().Contains(s, StringComparison.CurrentCultureIgnoreCase);
         }
     }
-}
+}

+ 1 - 2
src/Masuit.MyBlogs.Core/Common/HangfireHelper.cs

@@ -1,7 +1,6 @@
 using Hangfire;
 using Hangfire.Common;
 using Hangfire.States;
-using System;
 
 namespace Masuit.MyBlogs.Core.Common
 {
@@ -26,4 +25,4 @@ namespace Masuit.MyBlogs.Core.Common
             return string.IsNullOrEmpty(queue) ? Client.Create(job, new EnqueuedState()) : Client.Create(job, new EnqueuedState(queue));
         }
     }
-}
+}

+ 1 - 4
src/Masuit.MyBlogs.Core/Common/HttpContextExtension.cs

@@ -1,9 +1,6 @@
 using DnsClient;
 using Masuit.Tools;
-using Microsoft.AspNetCore.Http;
 using Microsoft.Net.Http.Headers;
-using System.Linq;
-using System.Threading;
 
 namespace Masuit.MyBlogs.Core.Common
 {
@@ -50,4 +47,4 @@ namespace Masuit.MyBlogs.Core.Common
             return robotUA;
         }
     }
-}
+}

+ 5 - 38
src/Masuit.MyBlogs.Core/Common/ImagebedClient.cs

@@ -4,17 +4,7 @@ using Masuit.Tools;
 using Masuit.Tools.Html;
 using Masuit.Tools.Logging;
 using Masuit.Tools.Systems;
-using Microsoft.Extensions.Configuration;
-using Newtonsoft.Json.Linq;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.Http;
 using System.Net.Http.Headers;
-using System.Net.Http.Json;
-using System.Threading;
-using System.Threading.Tasks;
 using System.Web;
 
 namespace Masuit.MyBlogs.Core.Common
@@ -71,7 +61,7 @@ namespace Masuit.MyBlogs.Core.Common
                 return UploadGitlab(gitlab, stream, file, cancellationToken);
             }
 
-            return UploadKieng(stream, cancellationToken);
+            return Task.FromResult<(string, bool)>((null, false));
         }
 
         /// <summary>
@@ -102,7 +92,7 @@ namespace Masuit.MyBlogs.Core.Common
                 }
 
                 LogManager.Info("图片上传到gitee失败。");
-                return UploadKieng(stream, cancellationToken).Result;
+                return (null, false);
             });
         }
 
@@ -140,7 +130,7 @@ namespace Masuit.MyBlogs.Core.Common
                 }
 
                 LogManager.Info("图片上传到gitee失败。");
-                return UploadKieng(stream, cancellationToken).Result;
+                return (null, false);
             });
         }
 
@@ -179,33 +169,10 @@ namespace Masuit.MyBlogs.Core.Common
 
                 LogManager.Info($"图片上传到gitlab({config.ApiUrl})失败。");
                 _failedList.Add(config.ApiUrl);
-                return UploadKieng(stream, cancellationToken).Result;
+                return (null, false);
             });
         }
 
-        /// <summary>
-        /// 上传到聚合图床
-        /// </summary>
-        /// <param name="stream"></param>
-        /// <param name="cancellationToken"></param>
-        /// <returns></returns>
-        private async Task<(string url, bool success)> UploadKieng(Stream stream, CancellationToken cancellationToken)
-        {
-            if (bool.TryParse(_config["Imgbed:EnableExternalImgbed"], out var b) && b)
-            {
-                using var formData = new MultipartFormDataContent
-                {
-                    { new StreamContent(stream), "image","1.jpg" }
-                };
-                var resp = await _httpClient.PostAsync("https://image.kieng.cn/upload.html?type=" + new[] { "jd", "c58", "sg", "sh", "wy" }.OrderByRandom().First(), formData, cancellationToken);
-                var json = await resp.Content.ReadAsStringAsync();
-                var result = JObject.Parse(json);
-                return ((string)result["data"]["url"], (int)result["code"] == 200);
-            }
-
-            return (null, false);
-        }
-
         /// <summary>
         /// 替换img标签的src属性
         /// </summary>
@@ -244,4 +211,4 @@ namespace Masuit.MyBlogs.Core.Common
             return content;
         }
     }
-}
+}

+ 5 - 4
src/Masuit.MyBlogs.Core/Common/Mails/IMailSender.cs

@@ -1,12 +1,13 @@
-using System.Collections.Generic;
-
-namespace Masuit.MyBlogs.Core.Common.Mails
+namespace Masuit.MyBlogs.Core.Common.Mails
 {
     public interface IMailSender
     {
         void Send(string title, string content, string tos);
+
         List<string> GetBounces();
+
         string AddRecipient(string email);
+
         public bool HasBounced(string address);
     }
-}
+}

+ 3 - 5
src/Masuit.MyBlogs.Core/Common/Mails/MailServiceCollectionExt.cs

@@ -1,7 +1,4 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Masuit.MyBlogs.Core.Common.Mails
+namespace Masuit.MyBlogs.Core.Common.Mails
 {
     public static class MailServiceCollectionExt
     {
@@ -12,6 +9,7 @@ namespace Masuit.MyBlogs.Core.Common.Mails
                 case "Mailgun":
                     services.AddHttpClient<IMailSender, MailgunSender>();
                     break;
+
                 default:
                     services.AddSingleton<IMailSender, SmtpSender>();
                     break;
@@ -20,4 +18,4 @@ namespace Masuit.MyBlogs.Core.Common.Mails
             return services;
         }
     }
-}
+}

+ 1 - 6
src/Masuit.MyBlogs.Core/Common/Mails/MailgunSender.cs

@@ -1,11 +1,6 @@
 using CacheManager.Core;
 using Masuit.Tools.Models;
-using Microsoft.Extensions.Configuration;
 using Newtonsoft.Json.Linq;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Http;
 using System.Net.Http.Headers;
 using System.Text;
 
@@ -73,4 +68,4 @@ namespace Masuit.MyBlogs.Core.Common.Mails
             }).Result;
         }
     }
-}
+}

+ 1 - 5
src/Masuit.MyBlogs.Core/Common/Mails/SmtpSender.cs

@@ -1,9 +1,5 @@
 using Masuit.Tools;
 using Masuit.Tools.Models;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
 using System.Text;
 
 namespace Masuit.MyBlogs.Core.Common.Mails
@@ -43,4 +39,4 @@ namespace Masuit.MyBlogs.Core.Common.Mails
             return GetBounces().Contains(address);
         }
     }
-}
+}

+ 0 - 3
src/Masuit.MyBlogs.Core/Common/PerfCounter.cs

@@ -2,9 +2,6 @@
 using Masuit.Tools.DateTimeExt;
 using Masuit.Tools.Hardware;
 using Masuit.Tools.Systems;
-using System;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Common
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Common/TrackData.cs

@@ -1,10 +1,6 @@
 using Masuit.Tools;
 using Newtonsoft.Json;
-using System;
 using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
 using System.Text;
 
 namespace Masuit.MyBlogs.Core.Common

+ 0 - 3
src/Masuit.MyBlogs.Core/Common/UserAgent.cs

@@ -1,7 +1,4 @@
 using Microsoft.Extensions.Caching.Memory;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Text.RegularExpressions;
 
 namespace Masuit.MyBlogs.Core.Common

+ 1 - 3
src/Masuit.MyBlogs.Core/Configs/AppConfig.cs

@@ -1,6 +1,4 @@
-using System.Collections.Generic;
-
-namespace Masuit.MyBlogs.Core.Configs
+namespace Masuit.MyBlogs.Core.Configs
 {
     /// <summary>
     /// 应用程序配置

+ 0 - 1
src/Masuit.MyBlogs.Core/Configs/HangfireJobInit.cs

@@ -1,7 +1,6 @@
 using Hangfire;
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Extensions.Hangfire;
-using System;
 
 namespace Masuit.MyBlogs.Core.Configs
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Controllers/AdminController.cs

@@ -1,5 +1,4 @@
 using AutoMapper;
-using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Configs;
 using Masuit.MyBlogs.Core.Extensions;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
@@ -7,11 +6,8 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Filters;
-using System;
-using System.Linq;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 5
src/Masuit.MyBlogs.Core/Controllers/BaseController.cs

@@ -15,17 +15,12 @@ using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Filters;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
 using System.Net;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/CategoryController.cs

@@ -6,8 +6,6 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Microsoft.AspNetCore.Mvc;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 7
src/Masuit.MyBlogs.Core/Controllers/CommentController.cs

@@ -15,18 +15,11 @@ using Masuit.Tools.Html;
 using Masuit.Tools.Logging;
 using Masuit.Tools.Models;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 0 - 4
src/Masuit.MyBlogs.Core/Controllers/DashboardController.cs

@@ -4,10 +4,6 @@ using Masuit.Tools;
 using Masuit.Tools.Logging;
 using Microsoft.AspNetCore.Mvc;
 using Polly;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
 using System.Text;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 0 - 1
src/Masuit.MyBlogs.Core/Controllers/DonateController.cs

@@ -3,7 +3,6 @@ using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Microsoft.AspNetCore.Mvc;
 using System.ComponentModel.DataAnnotations;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Controllers/Drive/AdminController.cs

@@ -6,10 +6,6 @@ using Microsoft.AspNetCore.Authorization;
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Serialization;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers.Drive
 {

+ 10 - 10
src/Masuit.MyBlogs.Core/Controllers/Drive/SitesController.cs

@@ -8,9 +8,6 @@ using Masuit.Tools.Core.Net;
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Serialization;
-using System;
-using System.IO;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers.Drive
 {
@@ -19,9 +16,9 @@ namespace Masuit.MyBlogs.Core.Controllers.Drive
     [Route("api/")]
     public class SitesController : Controller
     {
-        readonly IDriveAccountService _siteService;
-        readonly IDriveService _driveService;
-        readonly SettingService _setting;
+        private readonly IDriveAccountService _siteService;
+        private readonly IDriveService _driveService;
+        private readonly SettingService _setting;
 
         public UserInfoDto CurrentUser => HttpContext.Session.Get<UserInfoDto>(SessionKey.UserInfo) ?? new UserInfoDto();
 
@@ -32,8 +29,8 @@ namespace Masuit.MyBlogs.Core.Controllers.Drive
             this._setting = setting;
         }
 
-
         #region Actions
+
         /// <summary>
         /// 返回所有sites
         /// </summary>
@@ -46,6 +43,7 @@ namespace Masuit.MyBlogs.Core.Controllers.Drive
                 ContractResolver = new CamelCasePropertyNamesContractResolver()
             });
         }
+
         /// <summary>
         /// 根据路径获取文件夹内容
         /// </summary>
@@ -92,7 +90,7 @@ namespace Masuit.MyBlogs.Core.Controllers.Drive
                         ContractResolver = new CamelCasePropertyNamesContractResolver()
                     });
                 }
-                catch (Exception e)
+                catch
                 {
                     return NotFound(new ErrorResponse()
                     {
@@ -150,6 +148,7 @@ namespace Masuit.MyBlogs.Core.Controllers.Drive
                 ContractResolver = new CamelCasePropertyNamesContractResolver()
             });
         }
+
         /// <summary>
         /// 获得readme
         /// </summary>
@@ -250,6 +249,7 @@ namespace Masuit.MyBlogs.Core.Controllers.Drive
                 return StatusCode(500, e.Message);
             }
         }
-        #endregion
+
+        #endregion Actions
     }
-}
+}

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/Drive/UserController.cs

@@ -8,9 +8,7 @@ using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
 using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using System;
 using System.Web;
 
 namespace Masuit.MyBlogs.Core.Controllers.Drive

+ 0 - 5
src/Masuit.MyBlogs.Core/Controllers/ErrorController.cs

@@ -10,15 +10,10 @@ using Masuit.Tools.Security;
 using Masuit.Tools.Strings;
 using Masuit.Tools.Systems;
 using Microsoft.AspNetCore.Diagnostics;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.IO;
-using System.Linq;
 using System.Text;
-using System.Threading.Tasks;
 using System.Web;
 using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;
 

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/FirewallController.cs

@@ -5,10 +5,8 @@ using Masuit.Tools.AspNetCore.ResumeFileResults.Extensions;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Net.Http.Headers;
-using System;
 using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 0 - 7
src/Masuit.MyBlogs.Core/Controllers/HomeController.cs

@@ -15,21 +15,14 @@ using Masuit.Tools.AspNetCore.Mime;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Linq;
 using Masuit.Tools.Systems;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Linq.Dynamic.Core;
 using System.Linq.Expressions;
 using System.Runtime.InteropServices;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 7
src/Masuit.MyBlogs.Core/Controllers/LinksController.cs

@@ -5,15 +5,8 @@ using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.Tools;
-using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
-using System;
-using System.IO;
-using System.Linq;
-using System.Net.Http;
 using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/LoginController.cs

@@ -1,8 +1,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.ViewModel;
 using Microsoft.AspNetCore.Mvc;
-using System;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Controllers/MenuController.cs

@@ -6,10 +6,6 @@ using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.Tools.Systems;
 using Microsoft.AspNetCore.Mvc;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 5
src/Masuit.MyBlogs.Core/Controllers/MergeController.cs

@@ -13,16 +13,11 @@ using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Linq;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
-using System;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Linq.Expressions;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 6
src/Masuit.MyBlogs.Core/Controllers/MiscController.cs

@@ -7,14 +7,8 @@ using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools;
 using Masuit.Tools.Core.Net;
-using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Mvc;
-using System;
-using System.IO;
-using System.Linq;
 using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 7
src/Masuit.MyBlogs.Core/Controllers/MsgController.cs

@@ -16,18 +16,11 @@ using Masuit.Tools.Html;
 using Masuit.Tools.Logging;
 using Masuit.Tools.Models;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 1 - 5
src/Masuit.MyBlogs.Core/Controllers/NoticeController.cs

@@ -7,12 +7,8 @@ using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools.Core.Net;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using System;
 using System.ComponentModel.DataAnnotations;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {
@@ -44,7 +40,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                 n.PostDate = n.PostDate.ToTimeZone(HttpContext.Session.Get<string>(SessionKey.TimeZone));
                 n.Content = ReplaceVariables(n.Content);
             }
-            
+
             ViewBag.Ads = AdsService.GetByWeightedPrice(AdvertiseType.ListItem, Request.Location());
             return CurrentUser.IsAdmin ? View("Index_Admin", list.Data) : View(list.Data);
         }

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/PassportController.cs

@@ -14,9 +14,7 @@ using Masuit.Tools.Core.Net;
 using Masuit.Tools.Logging;
 using Masuit.Tools.Security;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
-using System;
 using System.Net;
 using System.Web;
 

+ 0 - 8
src/Masuit.MyBlogs.Core/Controllers/PostController.cs

@@ -28,23 +28,15 @@ using Masuit.Tools.Models;
 using Masuit.Tools.Security;
 using Masuit.Tools.Strings;
 using Masuit.Tools.Systems;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Linq.Dynamic.Core;
 using System.Linq.Expressions;
 using System.Net;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
 using SameSiteMode = Microsoft.AspNetCore.Http.SameSiteMode;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 0 - 4
src/Masuit.MyBlogs.Core/Controllers/SearchController.cs

@@ -9,12 +9,8 @@ using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools.Core.Net;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
-using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Controllers/SeminarController.cs

@@ -11,12 +11,9 @@ using Masuit.Tools.Core.Net;
 using Masuit.Tools.Linq;
 using Masuit.Tools.Systems;
 using Microsoft.AspNetCore.Mvc;
-using System;
 using System.ComponentModel.DataAnnotations;
-using System.Linq;
 using System.Linq.Dynamic.Core;
 using System.Runtime.InteropServices;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/ShareController.cs

@@ -1,8 +1,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Microsoft.AspNetCore.Mvc;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Controllers/SubscribeController.cs

@@ -11,13 +11,9 @@ using Masuit.Tools.Core.Net;
 using Masuit.Tools.Linq;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Net.Http.Headers;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using WilderMinds.RssSyndication;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 0 - 5
src/Masuit.MyBlogs.Core/Controllers/SystemController.cs

@@ -13,14 +13,9 @@ using Masuit.Tools.Systems;
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
-using System;
-using System.Collections.Generic;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Net;
 using System.Text;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 6
src/Masuit.MyBlogs.Core/Controllers/ToolsController.cs

@@ -8,17 +8,11 @@ using Masuit.Tools.Core.Validator;
 using Masuit.Tools.Models;
 using MaxMind.GeoIP2.Exceptions;
 using MaxMind.GeoIP2.Responses;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.Net.Http.Headers;
 using Newtonsoft.Json;
 using Polly;
-using System;
-using System.Linq;
 using System.Net;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
 using TimeZoneConverter;
 
 namespace Masuit.MyBlogs.Core.Controllers

+ 1 - 8
src/Masuit.MyBlogs.Core/Controllers/UploadController.cs

@@ -11,19 +11,12 @@ using Masuit.Tools.Core.Net;
 using Masuit.Tools.Html;
 using Masuit.Tools.Logging;
 using Masuit.Tools.Systems;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Newtonsoft.Json;
 using OpenXmlPowerTools;
 using Polly;
-using System;
 using System.ComponentModel.DataAnnotations;
-using System.IO;
-using System.Linq;
 using System.Text.RegularExpressions;
-using System.Threading;
-using System.Threading.Tasks;
 using System.Xml.Linq;
 
 namespace Masuit.MyBlogs.Core.Controllers
@@ -283,7 +276,7 @@ namespace Masuit.MyBlogs.Core.Controllers
                         var dir = Path.GetDirectoryName(path);
                         Directory.CreateDirectory(dir);
                         await using var fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.ReadWrite);
-                        await file.CopyToAsync(fs,CancellationToken.None);
+                        await file.CopyToAsync(fs, CancellationToken.None);
                         break;
                     }
                 case var _ when file.ContentType.StartsWith("audio") || file.ContentType.StartsWith("video"):

+ 0 - 2
src/Masuit.MyBlogs.Core/Controllers/UserController.cs

@@ -1,10 +1,8 @@
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Microsoft.AspNetCore.Mvc;
-using System;
 using System.Linq.Expressions;
 using System.Net;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Controllers/ValidateController.cs

@@ -3,7 +3,6 @@ using Masuit.MyBlogs.Core.Common;
 using Masuit.Tools.Core.Validator;
 using Masuit.Tools.Systems;
 using Microsoft.AspNetCore.Mvc;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Controllers/ValuesController.cs

@@ -3,7 +3,6 @@ using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.EntityFrameworkCore;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Controllers
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/OneDriveConfiguration.cs

@@ -1,7 +1,4 @@
-using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.Primitives;
-using System.IO;
-using System.Linq;
 
 namespace Masuit.MyBlogs.Core.Extensions.DriveHelpers
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/ProtectedApiCallHelper.cs

@@ -1,10 +1,6 @@
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
-using System;
-using System.Linq;
-using System.Net.Http;
 using System.Net.Http.Headers;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions.DriveHelpers
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/ServiceCollectionExtension.cs

@@ -1,6 +1,5 @@
 using Masuit.MyBlogs.Core.Infrastructure;
 using Masuit.MyBlogs.Core.Infrastructure.Drive;
-using Microsoft.Extensions.DependencyInjection;
 
 namespace Masuit.MyBlogs.Core.Extensions.DriveHelpers
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Extensions/DriveHelpers/TokenCacheHelper.cs

@@ -1,5 +1,4 @@
 using Microsoft.Identity.Client;
-using System.IO;
 
 namespace Masuit.MyBlogs.Core.Extensions.DriveHelpers
 {

+ 1 - 3
src/Masuit.MyBlogs.Core/Extensions/Firewall/AccessDenyException.cs

@@ -1,6 +1,4 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Extensions.Firewall
+namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {
     public class AccessDenyException : Exception
     {

+ 0 - 1
src/Masuit.MyBlogs.Core/Extensions/Firewall/AllowAccessFirewallAttribute.cs

@@ -1,5 +1,4 @@
 using Microsoft.AspNetCore.Mvc.Filters;
-using System;
 
 namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Extensions/Firewall/CloudflareRepoter.cs

@@ -1,12 +1,8 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.Tools.Logging;
-using Microsoft.Extensions.Configuration;
 using Polly;
 using System.Net;
-using System.Net.Http;
-using System.Net.Http.Json;
 using System.Net.Sockets;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Extensions/Firewall/DefaultFirewallRepoter.cs

@@ -1,5 +1,4 @@
 using System.Net;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Extensions/Firewall/FirewallAttribute.cs

@@ -8,11 +8,8 @@ using Masuit.Tools.Core.Net;
 using Masuit.Tools.Logging;
 using Masuit.Tools.Security;
 using Masuit.Tools.Strings;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Filters;
-using System;
-using System.Linq;
 using System.Net;
 using System.Text;
 using System.Text.RegularExpressions;

+ 1 - 4
src/Masuit.MyBlogs.Core/Extensions/Firewall/FirewallServiceCollectionExt.cs

@@ -1,7 +1,4 @@
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Masuit.MyBlogs.Core.Extensions.Firewall
+namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {
     public static class FirewallServiceCollectionExt
     {

+ 0 - 1
src/Masuit.MyBlogs.Core/Extensions/Firewall/IFirewallRepoter.cs

@@ -1,5 +1,4 @@
 using System.Net;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {

+ 1 - 3
src/Masuit.MyBlogs.Core/Extensions/Firewall/IpIntercepter.cs

@@ -1,6 +1,4 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Extensions.Firewall
+namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {
     public class IpIntercepter
     {

+ 0 - 4
src/Masuit.MyBlogs.Core/Extensions/Firewall/RequestInterceptMiddleware.cs

@@ -5,12 +5,8 @@ using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
-using Microsoft.AspNetCore.Http;
-using System;
-using System.Linq;
 using System.Text;
 using System.Text.RegularExpressions;
-using System.Threading.Tasks;
 using System.Web;
 using HeaderNames = Microsoft.Net.Http.Headers.HeaderNames;
 

+ 1 - 3
src/Masuit.MyBlogs.Core/Extensions/Firewall/TempDenyException.cs

@@ -1,6 +1,4 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Extensions.Firewall
+namespace Masuit.MyBlogs.Core.Extensions.Firewall
 {
     public class TempDenyException : Exception
     {

+ 0 - 4
src/Masuit.MyBlogs.Core/Extensions/MyAuthorizeAttribute.cs

@@ -5,12 +5,8 @@ using Masuit.MyBlogs.Core.Models.ViewModel;
 using Masuit.Tools.Core.Net;
 using Masuit.Tools.Security;
 using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Http;
 using Microsoft.AspNetCore.Mvc;
 using Microsoft.AspNetCore.Mvc.Filters;
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.Linq;
 using System.Web;
 
 namespace Masuit.MyBlogs.Core.Extensions

+ 1 - 3
src/Masuit.MyBlogs.Core/Extensions/NotFoundException.cs

@@ -1,6 +1,4 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Extensions
+namespace Masuit.MyBlogs.Core.Extensions
 {
     public class NotFoundException : Exception
     {

+ 0 - 3
src/Masuit.MyBlogs.Core/Extensions/TranslateMiddleware.cs

@@ -1,11 +1,8 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.Tools;
 using Masuit.Tools.AspNetCore.Mime;
-using Microsoft.AspNetCore.Http;
 using Microsoft.International.Converters.TraditionalChineseToSimplifiedConverter;
-using System.IO;
 using System.Text;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions
 {

+ 1 - 4
src/Masuit.MyBlogs.Core/Extensions/UEditor/ConfigHandler.cs

@@ -1,7 +1,4 @@
-using Microsoft.AspNetCore.Http;
-using System.Threading.Tasks;
-
-namespace Masuit.MyBlogs.Core.Extensions.UEditor
+namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {
     /// <summary>
     /// Config 的摘要说明

+ 0 - 7
src/Masuit.MyBlogs.Core/Extensions/UEditor/CrawlerHandler.cs

@@ -2,14 +2,7 @@
 using Masuit.Tools;
 using Masuit.Tools.AspNetCore.Mime;
 using Masuit.Tools.Logging;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.IO;
 using System.Net;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {

+ 1 - 3
src/Masuit.MyBlogs.Core/Extensions/UEditor/Handler.cs

@@ -1,6 +1,4 @@
-using Microsoft.AspNetCore.Http;
-using Newtonsoft.Json;
-using System.Threading.Tasks;
+using Newtonsoft.Json;
 
 namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {

+ 1 - 8
src/Masuit.MyBlogs.Core/Extensions/UEditor/ListFileManager.cs

@@ -1,11 +1,4 @@
-using Microsoft.AspNetCore.Http;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-
-namespace Masuit.MyBlogs.Core.Extensions.UEditor
+namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {
     /// <summary>
     /// FileManager 的摘要说明

+ 1 - 4
src/Masuit.MyBlogs.Core/Extensions/UEditor/NotSupportedHandler.cs

@@ -1,7 +1,4 @@
-using Microsoft.AspNetCore.Http;
-using System.Threading.Tasks;
-
-namespace Masuit.MyBlogs.Core.Extensions.UEditor
+namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {
     /// <summary>
     /// NotSupportedHandler 的摘要说明

+ 0 - 2
src/Masuit.MyBlogs.Core/Extensions/UEditor/PathFormatter.cs

@@ -1,6 +1,4 @@
 using Masuit.Tools.DateTimeExt;
-using System;
-using System.IO;
 using System.Text.RegularExpressions;
 
 namespace Masuit.MyBlogs.Core.Extensions.UEditor

+ 0 - 3
src/Masuit.MyBlogs.Core/Extensions/UEditor/UeditorConfig.cs

@@ -1,7 +1,4 @@
 using Newtonsoft.Json.Linq;
-using System;
-using System.IO;
-using System.Linq;
 
 namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {

+ 0 - 7
src/Masuit.MyBlogs.Core/Extensions/UEditor/UploadHandler.cs

@@ -1,13 +1,6 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.Tools;
 using Masuit.Tools.Logging;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.DependencyInjection;
-using System;
-using System.IO;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Extensions.UEditor
 {

+ 0 - 5
src/Masuit.MyBlogs.Core/Infrastructure/Drive/DriveAccountService.cs

@@ -1,11 +1,6 @@
 using Masuit.MyBlogs.Core.Extensions.DriveHelpers;
 using Masuit.MyBlogs.Core.Models.Drive;
 using Microsoft.Identity.Client;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Net.Http;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Drive
 {

+ 0 - 6
src/Masuit.MyBlogs.Core/Infrastructure/Drive/DriveService.cs

@@ -2,12 +2,6 @@ using Masuit.MyBlogs.Core.Extensions.DriveHelpers;
 using Masuit.MyBlogs.Core.Models.Drive;
 using Masuit.Tools;
 using Microsoft.Graph;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Net.Http;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Drive
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Infrastructure/Drive/IDriveAccountService.cs

@@ -1,7 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Drive;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using static Masuit.MyBlogs.Core.Infrastructure.Drive.DriveAccountService;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Drive
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Drive/IDriveService.cs

@@ -1,6 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Drive;
-using System.Collections.Generic;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Drive
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Infrastructure/Drive/SettingService.cs

@@ -1,7 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Drive;
-using System;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Drive
 {

+ 0 - 5
src/Masuit.MyBlogs.Core/Infrastructure/Drive/TokenService.cs

@@ -1,12 +1,7 @@
 using Masuit.MyBlogs.Core.Extensions.DriveHelpers;
 using Microsoft.Graph.Auth;
 using Microsoft.Identity.Client;
-using System;
-using System.IO;
 using System.Net;
-using System.Net.Http;
-using System.Threading;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Drive
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Infrastructure/DriveContext.cs

@@ -2,7 +2,6 @@ using Masuit.MyBlogs.Core.Extensions.DriveHelpers;
 using Masuit.MyBlogs.Core.Models.Drive;
 using Microsoft.EntityFrameworkCore;
 using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using System;
 
 namespace Masuit.MyBlogs.Core.Infrastructure
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Infrastructure/Repository/BaseRepository.cs

@@ -7,11 +7,7 @@ using Masuit.Tools.Core.AspNetCore;
 using Masuit.Tools.Models;
 using Masuit.Tools.Systems;
 using Microsoft.EntityFrameworkCore;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 using Z.EntityFramework.Plus;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository

+ 0 - 3
src/Masuit.MyBlogs.Core/Infrastructure/Repository/CommentRepository.cs

@@ -2,10 +2,7 @@
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.Tools.Models;
 using Microsoft.EntityFrameworkCore;
-using System;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Repository/Interface/ISearchDetailsRepository.cs

@@ -1,6 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Entity;
-using System;
-using System.Collections.Generic;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository.Interface
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Infrastructure/Repository/LeaveMessageRepository.cs

@@ -2,10 +2,7 @@
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.Tools.Models;
 using Microsoft.EntityFrameworkCore;
-using System;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Infrastructure/Repository/MenuRepository.cs

@@ -2,9 +2,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Microsoft.EntityFrameworkCore;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
 using Z.EntityFramework.Plus;
 

+ 0 - 4
src/Masuit.MyBlogs.Core/Infrastructure/Repository/PostRepository.cs

@@ -2,11 +2,7 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Microsoft.EntityFrameworkCore;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository
 {

+ 0 - 3
src/Masuit.MyBlogs.Core/Infrastructure/Repository/SearchDetailsRepository.cs

@@ -1,8 +1,5 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Repository
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Infrastructure/Services/BaseService.cs

@@ -3,11 +3,7 @@ using Masuit.LuceneEFCore.SearchEngine.Interfaces;
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.Tools.Models;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Services/CategoryService.cs

@@ -2,8 +2,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IAdvertisementService.cs

@@ -1,7 +1,6 @@
 using Masuit.MyBlogs.Core.Common;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
-using System.Collections.Generic;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {

+ 0 - 4
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IBaseService.cs

@@ -1,10 +1,6 @@
 using Masuit.LuceneEFCore.SearchEngine;
 using Masuit.Tools.Models;
-using System;
-using System.Collections.Generic;
-using System.Linq;
 using System.Linq.Expressions;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/ICategoryService.cs

@@ -1,5 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Entity;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IMenuService.cs

@@ -1,5 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Entity;
-using System.Collections.Generic;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/IPostService.cs

@@ -1,8 +1,6 @@
 using Masuit.MyBlogs.Core.Models.DTO;
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.ViewModel;
-using System.Collections.Generic;
-using System.Threading.Tasks;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Services/Interface/ISearchDetailsService.cs

@@ -1,6 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Entity;
-using System;
-using System.Collections.Generic;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services.Interface
 {

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Services/MenuService.cs

@@ -2,8 +2,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
-using System.Collections.Generic;
-using System.Linq;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {

+ 1 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Services/PostService.cs

@@ -1,5 +1,4 @@
-using System.Linq;
-using CacheManager.Core;
+using CacheManager.Core;
 using Masuit.LuceneEFCore.SearchEngine;
 using Masuit.LuceneEFCore.SearchEngine.Interfaces;
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;

+ 0 - 2
src/Masuit.MyBlogs.Core/Infrastructure/Services/SearchDetailsService.cs

@@ -2,8 +2,6 @@
 using Masuit.MyBlogs.Core.Infrastructure.Repository.Interface;
 using Masuit.MyBlogs.Core.Infrastructure.Services.Interface;
 using Masuit.MyBlogs.Core.Models.Entity;
-using System;
-using System.Collections.Generic;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {

+ 0 - 1
src/Masuit.MyBlogs.Core/Infrastructure/Services/UserInfoService.cs

@@ -7,7 +7,6 @@ using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.Tools;
 using Masuit.Tools.DateTimeExt;
 using Masuit.Tools.Security;
-using System;
 
 namespace Masuit.MyBlogs.Core.Infrastructure.Services
 {

+ 4 - 4
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.csproj

@@ -37,7 +37,7 @@
     </ItemGroup>
 
     <ItemGroup>
-        <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
+        <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.2.0" />
         <PackageReference Include="AutoMapper.Extensions.ExpressionMapping" Version="4.1.3" />
         <PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
         <PackageReference Include="CacheManager.Serialization.Json" Version="1.2.0" />
@@ -56,14 +56,14 @@
         <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
         <PackageReference Include="Microsoft.EntityFrameworkCore.Proxies" Version="6.0.0" />
         <PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.0" />
-        <PackageReference Include="Microsoft.Graph" Version="4.9.0" />
+        <PackageReference Include="Microsoft.Graph" Version="4.10.0" />
         <PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.7" />
         <PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
         <PackageReference Include="OpenXmlPowerTools-NetStandard" Version="4.4.21" />
         <PackageReference Include="MiniProfiler.EntityFrameworkCore" Version="4.2.22" />
         <PackageReference Include="PanGu.HighLight" Version="1.0.0" />
-        <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0-rc.1" />
-        <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.13" />
+        <PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.0" />
+        <PackageReference Include="System.Linq.Dynamic.Core" Version="1.2.14" />
         <PackageReference Include="TimeZoneConverter" Version="3.5.0" />
         <PackageReference Include="WilderMinds.RssSyndication" Version="1.7.0" />
         <PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="6.13.0" />

+ 0 - 1
src/Masuit.MyBlogs.Core/Models/Command/SearchDetailsCommand.cs

@@ -1,4 +1,3 @@
-using System;
 using System.ComponentModel.DataAnnotations;
 
 namespace Masuit.MyBlogs.Core.Models.Command

+ 0 - 1
src/Masuit.MyBlogs.Core/Models/DTO/AdvertisementDto.cs

@@ -1,5 +1,4 @@
 using Masuit.MyBlogs.Core.Models.Entity;
-using System;
 using System.ComponentModel.DataAnnotations;
 
 namespace Masuit.MyBlogs.Core.Models.DTO

+ 1 - 3
src/Masuit.MyBlogs.Core/Models/DTO/CommentDto.cs

@@ -1,6 +1,4 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.DTO
 {
     /// <summary>
     /// 文章评论输出模型

+ 1 - 3
src/Masuit.MyBlogs.Core/Models/DTO/DonateDto.cs

@@ -1,6 +1,4 @@
-using System;
-
-namespace Masuit.MyBlogs.Core.Models.DTO
+namespace Masuit.MyBlogs.Core.Models.DTO
 {
     /// <summary>
     /// 打赏表

Някои файлове не бяха показани, защото твърде много файлове са промени