added options

master
Young 7 months ago
parent 010213d4a2
commit ee069bdda6

@ -24,4 +24,7 @@
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
</ItemGroup>
<ItemGroup>
<Folder Include="Extensions\" />
</ItemGroup>
</Project>

@ -0,0 +1,14 @@
namespace Infrastructure.Options;
public sealed class AudienceOptions : OptionsBase
{
public const string Name = "Audience";
public string Issuer { get; set; }
public string Audience { get; set; }
public string Secret { get; set; }
public int Expiration { get; set; }
}

@ -0,0 +1,6 @@
namespace Infrastructure.Options;
public abstract class OptionsBase
{
public bool IsEnable { get; set; }
}

@ -0,0 +1,12 @@
namespace Infrastructure.Options;
public sealed class RedisOptions : OptionsBase
{
public const string Name = "Redis";
public string InstanceName { get; set; }
public string Host { get; set; }
public string Password { get; set; }
}

@ -0,0 +1,23 @@
namespace Infrastructure.Options;
public sealed class SqlSugarOptions : OptionsBase
{
public const string Name = "SqlSugar";
public SnowFlakeOptions? SnowFlake { get; set; }
public string Server { get; set; }
public int? Port { get; set; }
public string Database { get; set; }
public string UserId { get; set; }
public string Password { get; set; }
}
public class SnowFlakeOptions : OptionsBase
{
public int WorkerId { get; set; }
}

@ -0,0 +1,11 @@
namespace Infrastructure.Options;
public class VersionOptions : OptionsBase
{
public const string Name = "Version";
public string HeaderName { get; set; }
public string ParameterName { get; set; }
public string SwaggerTitle { get; set; }
}
Loading…
Cancel
Save