using Furion.ConfigurableOptions;
using System.Collections.Generic;
namespace Magic.Core;
///
/// 缓存配置
///
public class CacheOptions : IConfigurableOptions
{
///
/// 缓存类型
///
public CacheType CacheType { get; set; }
///
/// Redis配置
///
public string RedisConnectionString { get; set; }
}
///
/// 系统配置
///
public class SystemSettingsOptions : IConfigurableOptions
{
///
/// 超管是否可以查看所有租户的数据
///
public bool SuperAdminViewAllData { get; set; }
///
/// 是否开启全局请求日志
///
public bool IsGlobalRequestLog { get; set; }
}
///
/// 雪花Id配置
///
public class SnowIdOptions : IConfigurableOptions
{
///
/// 取值范围0~63,默认1
///
public string WorkerId { get; set; } = "1";
}
///
/// 第三方配置
///
public class OAuthOptions : IConfigurableOptions
{
///
///微信
///
public ThirdParty Wechat { get; set; }
}
///
/// 上传文件
///
public class UploadFileOptions : IConfigurableOptions
{
///
/// 阿里云
///
public FileDescription Aliyun { get; set; }
///
/// 头像
///
public FileDescription Avatar { get; set; }
///
/// 文档
///
public FileDescription Document { get; set; }
///
/// 商店
///
public FileDescription Shop { get; set; }
///
/// 编辑器
///
public FileDescription Editor { get; set; }
///
/// 默认
///
public FileDescription Default { get; set; }
}
///
/// 数据库配置
///
public class ConnectionStringsOptions : IConfigurableOptions
{
///
/// 默认数据库编号
///
public string DefaultDbNumber { get; set; }
///
/// 默认数据库类型
///
public string DefaultDbType { get; set; }
///
/// 默认数据库连接字符串
///
public string DefaultDbString { get; set; }
///
/// 业务库集合
///
public List DbConfigs { get; set; }
}
///
/// JWT配置
///
public class JWTSettingsOptions : IConfigurableOptions
{
///
/// 是否验证密钥
///
public bool ValidateIssuerSigningKey { get; set; }
///
/// 密钥
///
public string IssuerSigningKey { get; set; }
///
/// 是否验证签发方
///
public bool ValidateIssuer { get; set; }
///
/// 签发方
///
public string ValidIssuer { get; set; }
///
/// 是否验证签收方
///
public bool ValidateAudience { get; set; }
///
/// 签收方
///
public string ValidAudience { get; set; }
///
/// 是否验证过期时间
///
public bool ValidateLifetime { get; set; }
///
/// 过期时间
///
public long ExpiredTime { get; set; }
///
/// 过期时间容错值
///
public long ClockSkew { get; set; }
}
///
/// 数据库参数
///
public class DbConfig
{
///
/// 数据库编号
///
public string DbNumber { get; set; }
///
/// 数据库类型
///
public string DbType { get; set; }
///
/// 数据库连接字符串
///
public string DbString { get; set; }
}
///
/// 文件参数
///
public class FileDescription
{
///
/// 路径
///
public string path { get; set; }
///
/// 大小
///
public long maxSize { get; set; }
///
/// 类型
///
public string[] contentType { get; set; }
}
///
/// 第三方参数
///
public class ThirdParty
{
///
/// id
///
public string app_id { get; set; }
///
/// key
///
public string app_key { get; set; }
///
/// 回调地址
///
public string redirect_uri { get; set; }
///
/// scope
///
public string scope { get; set; }
}