using System.Collections.Generic; using Swashbuckle.AspNetCore.SwaggerUI; namespace SimApi.Configs; /// /// 文档组配置 /// public class SimApiDocGroupOption { /// /// 文档标识 /// public string Id { get; set; } /// /// 文档名称 /// public string Name { get; set; } /// /// 文档描述 /// public string Description { get; set; } } /// /// 授权配置, Type支持 "SimApiAuth","ClientCredentials","Implicit","AuthorizationCode" /// public class SimApiAuthOption { public string[] Type { get; set; } = new[] { "SimApiAuth" }; public string Description { get; set; } = "认证服务器颁发的AccessToken"; public string AuthorizationUrl { get; set; } public string TokenUrl { get; set; } public Dictionary Scopes { get; set; } } /// /// 文档配置 /// public class SimApiDocOptions { /// /// 文档组配置 /// public SimApiDocGroupOption[] ApiGroups { get; set; } = new[] { new SimApiDocGroupOption { Id = "api", Name = "Api", Description = "Api接口文档" } }; /// /// 授权配置 /// public SimApiAuthOption ApiAuth { get; set; } = new SimApiAuthOption(); /// /// 文档页面标题 /// public string DocumentTitle { get; set; } = "API接口文档"; /// /// 接口支持的调用方式 /// public SubmitMethod[] SupportedMethod { get; set; } = new[] { SubmitMethod.Post }; }