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