From 6023cf2eb06c17f00bb1e9b37a6d8dbef3cf074f Mon Sep 17 00:00:00 2001 From: xRain Date: Wed, 29 Jun 2022 03:03:51 +0800 Subject: [PATCH] fix default option, add option description --- Configurations/SimApiOptions.cs | 46 +++++++++++++++++++++++--- Configurations/SimApiStorageOptions.cs | 13 ++++++++ 2 files changed, 55 insertions(+), 4 deletions(-) diff --git a/Configurations/SimApiOptions.cs b/Configurations/SimApiOptions.cs index 526cbf9..2ab28b6 100644 --- a/Configurations/SimApiOptions.cs +++ b/Configurations/SimApiOptions.cs @@ -4,24 +4,62 @@ namespace SimApi.Configs { public class SimApiOptions { - public bool EnableCors { get; set; } = false; + /// + /// 启用全部Cors,对于开发前后分离的时候很有用。 + /// default: true + /// + public bool EnableCors { get; set; } = true; + /// + /// 启用SimapiAuth,一个简单的基于Header Token的认证方式。 + /// default: false + /// public bool EnableSimApiAuth { get; set; } = false; + /// + /// 启用在线文档,启用后 访问 /swagger 可以查看对应的api文档。 + /// default: false + /// public bool EnableSimApiDoc { get; set; } = false; - public bool EnableSimApiException { get; set; } = false; + /// + /// 启用异常拦截,启用后,所有的异常将被通过json反馈。 + /// default: true + /// + public bool EnableSimApiException { get; set; } = true; + /// + /// 开启S3兼容的存储系统。 + /// default: false + /// public bool EnableSimApiStorage { get; set; } = false; - public bool EnableForwardHeaders { get; set; } = false; + /// + /// 开启ForwardHeaders,开启后可以透传负载均衡的Headers + /// default: true + /// + public bool EnableForwardHeaders { get; set; } = true; - public bool EnableLowerUrl { get; set; } = false; + /// + /// 将所有的url都格式化为小写字母 + /// default: true + /// + public bool EnableLowerUrl { get; set; } = true; + /// + /// 启用格式化的 Console Logger + /// default: false + /// public bool EnableLogger { get; set; } = false; + /// + /// Swagger文档相关配置,需要启用 EnableSimApiDoc + /// public SimApiDocOptions SimApiDocOptions { get; set; } = new SimApiDocOptions(); + /// + /// S3兼容的存储系统配置,需要启用 EnableSimApiStorage + /// public SimApiStorageOptions SimApiStorageOptions { get; set; } = new SimApiStorageOptions(); diff --git a/Configurations/SimApiStorageOptions.cs b/Configurations/SimApiStorageOptions.cs index fdd3110..92ade77 100644 --- a/Configurations/SimApiStorageOptions.cs +++ b/Configurations/SimApiStorageOptions.cs @@ -2,10 +2,23 @@ namespace SimApi.Configs { public class SimApiStorageOptions { + /// + /// S3 服务器入口地址 + /// public string Endpoint { get; set; } + + /// + /// S3 服务器文件访问地址 + /// public string ServeUrl { get; set; } + + /// + /// S3服务 Bucket + /// public string Bucket { get; set; } + public string AccessKey { get; set; } + public string SecretKey { get; set; } } } \ No newline at end of file