diff --git a/FileService/FileServiceProvider.cs b/FileService/FileServiceProvider.cs index 8a736b7..67dfa63 100644 --- a/FileService/FileServiceProvider.cs +++ b/FileService/FileServiceProvider.cs @@ -26,19 +26,19 @@ namespace Ufangx.FileServices public IEnumerable AuthenticationSchemes => options.AuthenticationSchemes; - public string DefaultSchemeName => options.DefaultTopic; + public string DefaultSchemeName => options.DefaultScheme; FileServiceScheme GetScheme(string name) { if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentException("message", nameof(name)); } - var topic = options.SchemeMap[name]; - if (topic == null) + var scheme = options.SchemeMap[name]; + if (scheme == null) { throw new Exception($"无效的文件服务方案名称“{name}”"); } - return topic; + return scheme; } public IFileHandler GetHandler(string schemeName) { diff --git a/FileService/Models/FileServiceOptions.cs b/FileService/Models/FileServiceOptions.cs index 00f2730..1e893cc 100644 --- a/FileService/Models/FileServiceOptions.cs +++ b/FileService/Models/FileServiceOptions.cs @@ -9,7 +9,7 @@ namespace Ufangx.FileServices.Models { private readonly IList _schemes = new List(); private readonly IList _authenticationSchemes = new List(); - public string DefaultTopic { get; set; } + public string DefaultScheme { get; set; } public IEnumerable Schemes => _schemes; public IEnumerable AuthenticationSchemes => _authenticationSchemes; public IDictionary SchemeMap { get; } = new Dictionary(StringComparer.Ordinal); diff --git a/TestWeb/Startup.cs b/TestWeb/Startup.cs index 1d044fc..cfedbe2 100644 --- a/TestWeb/Startup.cs +++ b/TestWeb/Startup.cs @@ -27,7 +27,7 @@ namespace TestWeb public void ConfigureServices(IServiceCollection services) { services.AddHttpContextAccessor(); - services.AddFileServiceBuilder(opt=>opt.DefaultTopic="") + services.AddFileServiceBuilder(opt=>opt.DefaultScheme="") .AddLocalServices(o => o.StorageRootDir = hostEnvironment.ContentRootPath); services.AddControllersWithViews(); }