OptionsSetting.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. using System.Collections.Generic;
  2. namespace Infrastructure.Model
  3. {
  4. /// <summary>
  5. /// 获取配置文件POCO实体类
  6. /// </summary>
  7. public class OptionsSetting
  8. {
  9. /// <summary>
  10. /// 是否单点登录
  11. /// </summary>
  12. public bool SingleLogin { get; set; }
  13. /// <summary>
  14. /// 是否演示模式
  15. /// </summary>
  16. public bool DemoMode { get; set; }
  17. /// <summary>
  18. /// 初始化db
  19. /// </summary>
  20. public bool InitDb { get; set; }
  21. public MailOptions MailOptions { get; set; }
  22. public Upload Upload { get; set; }
  23. public ALIYUN_OSS ALIYUN_OSS { get; set; }
  24. public JwtSettings JwtSettings { get; set; }
  25. public CodeGen CodeGen { get; set; }
  26. public List<DbConfigs> DbConfigs { get; set; }
  27. public DbConfigs CodeGenDbConfig { get; set; }
  28. }
  29. /// <summary>
  30. /// 发送邮件数据配置
  31. /// </summary>
  32. public class MailOptions
  33. {
  34. public string FromName { get; set; }
  35. public string FromEmail { get; set; }
  36. public string Password { get; set; }
  37. public string Smtp { get; set; }
  38. public int Port { get; set; }
  39. public bool UseSsl { get; set; }
  40. public string Signature { get; set; }
  41. }
  42. /// <summary>
  43. /// 上传
  44. /// </summary>
  45. public class Upload
  46. {
  47. public string UploadUrl { get; set; }
  48. public string LocalSavePath { get; set; }
  49. public int MaxSize { get; set; }
  50. public string[] NotAllowedExt { get; set; } = new string[0];
  51. }
  52. /// <summary>
  53. /// 阿里云存储
  54. /// </summary>
  55. public class ALIYUN_OSS
  56. {
  57. public string REGIONID { get; set; }
  58. public string KEY { get; set; }
  59. public string SECRET { get; set; }
  60. public string BucketName { get; set; }
  61. public string DomainUrl { get; set; }
  62. public int MaxSize { get; set; } = 100;
  63. }
  64. /// <summary>
  65. /// Jwt
  66. /// </summary>
  67. public class JwtSettings
  68. {
  69. /// <summary>
  70. /// token是谁颁发的
  71. /// </summary>
  72. public string Issuer { get; set; }
  73. /// <summary>
  74. /// token可以给那些客户端使用
  75. /// </summary>
  76. public string Audience { get; set; }
  77. /// <summary>
  78. /// 加密的key(SecretKey必须大于16个,是大于,不是大于等于)
  79. /// </summary>
  80. public string SecretKey { get; set; }
  81. /// <summary>
  82. /// token时间(分)
  83. /// </summary>
  84. public int Expire { get; set; } = 1440;
  85. /// <summary>
  86. /// 刷新token时长
  87. /// </summary>
  88. public int RefreshTokenTime { get; set; }
  89. /// <summary>
  90. /// token类型
  91. /// </summary>
  92. public string TokenType { get; set; } = "Bearer";
  93. }
  94. public class CodeGen
  95. {
  96. public bool ShowApp { get; set; }
  97. public bool AutoPre { get; set; }
  98. public string VuePath { get; set; }
  99. public string Author { get; set; }
  100. public string TablePrefix { get; set; }
  101. public string ModuleName { get; set; }
  102. public int FrontTpl { get; set; }
  103. public CsharpTypeArr CsharpTypeArr { get; set; }
  104. }
  105. public class DbConfigs
  106. {
  107. public string Conn { get; set; }
  108. public int DbType { get; set; }
  109. public string ConfigId { get; set; }
  110. public bool IsAutoCloseConnection { get; set; }
  111. public string DbName { get; set; }
  112. }
  113. public class CsharpTypeArr
  114. {
  115. public string[] String { get; set; }
  116. public string[] Int { get; set; }
  117. public string[] Long { get; set; }
  118. public string[] DateTime { get; set; }
  119. public string[] Float { get; set; }
  120. public string[] Decimal { get; set; }
  121. public string[] Bool { get; set; }
  122. }
  123. public class OssConfigs
  124. {
  125. public string Host { get; set; }
  126. public string Endpoint { get; set; }
  127. public string Key { get; set; }
  128. public string Secret { get; set; }
  129. public string BucketName { get; set; }
  130. }
  131. }