Config.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. namespace Domain.Entities.Common
  2. {
  3. public sealed class Config
  4. {
  5. public int ID { get; private set; }
  6. public DateTime LastUpdatedAt { get; private set; } = DateTime.UtcNow;
  7. public byte[] RowVersion { get; private set; } = [];
  8. public BasicConfig Basic { get; private set; } = new();
  9. public ImagesConfig Images { get; private set; } = new();
  10. public MetaConfig Meta { get; private set; } = new();
  11. public CompanyConfig Company { get; private set; } = new();
  12. public AccountConfig Account { get; private set; } = new();
  13. public EmailTemplateConfig EmailTemplate { get; private set; } = new();
  14. public ExternalApiConfig External { get; private set; } = new();
  15. public PaymentConfig Payment { get; private set; } = new();
  16. private Config() { }
  17. public static Config Create()
  18. {
  19. return new();
  20. }
  21. public void Update(
  22. BasicConfig basic,
  23. ImagesConfig images,
  24. MetaConfig meta,
  25. CompanyConfig company,
  26. AccountConfig account,
  27. EmailTemplateConfig emailTemplate,
  28. ExternalApiConfig external,
  29. PaymentConfig payment
  30. ) {
  31. Basic = basic ?? throw new ArgumentNullException(nameof(basic));
  32. Images = images ?? throw new ArgumentNullException(nameof(images));
  33. Meta = meta ?? throw new ArgumentNullException(nameof(meta));
  34. Company = company ?? throw new ArgumentNullException(nameof(company));
  35. Account = account ?? throw new ArgumentNullException(nameof(account));
  36. EmailTemplate = emailTemplate ?? throw new ArgumentNullException(nameof(emailTemplate));
  37. External = external ?? throw new ArgumentNullException(nameof(external));
  38. Payment = payment ?? throw new ArgumentNullException(nameof(payment));
  39. LastUpdatedAt = DateTime.UtcNow;
  40. }
  41. }
  42. #region Owned Groups
  43. // ==================================================
  44. // 기본 정보 (Basic)
  45. // ==================================================
  46. public sealed class BasicConfig
  47. {
  48. public string? SiteName { get; set; }
  49. public string? SiteURL { get; set; }
  50. public string? RootID { get; set; }
  51. public string? FromEmail { get; set; }
  52. public string? FromName { get; set; }
  53. public string? SmtpServer { get; set; }
  54. public int? SmtpPort { get; set; }
  55. public bool SmtpEnableSSL { get; set; }
  56. public string? SmtpUsername { get; set; }
  57. public string? SmtpPassword { get; set; }
  58. public string? AdminWhiteIPList { get; set; }
  59. public string? FrontWhiteIPList { get; set; }
  60. public string? BlockAlertTitle { get; set; }
  61. public string? BlockAlertContent { get; set; }
  62. public bool IsMaintenance { get; set; } = false;
  63. public string? MaintenanceContent { get; set; }
  64. }
  65. // ==================================================
  66. // 기본 이미지 (Images)
  67. // ==================================================
  68. public sealed class ImagesConfig
  69. {
  70. public string? Favicon { get; set; }
  71. public string? LogoSquare { get; set; }
  72. public string? LogoHorizontal { get; set; }
  73. public string? OgDefault { get; set; }
  74. public string? TwitterImage { get; set; }
  75. public string? AppleTouchIcon { get; set; }
  76. public string? AppIcon_192 { get; set; }
  77. public string? AppIcon_512 { get; set; }
  78. }
  79. // ==================================================
  80. // 메타 태그 (Meta)
  81. // ==================================================
  82. public sealed class MetaConfig
  83. {
  84. public string? Keywords { get; set; }
  85. public string? Description { get; set; }
  86. public string? Author { get; set; }
  87. public string? Viewport { get; set; }
  88. public string? ApplicationName { get; set; }
  89. public string? Generator { get; set; }
  90. public string? Robots { get; set; }
  91. public string? Adds { get; set; }
  92. }
  93. // ==================================================
  94. // 회사 정보 (Company)
  95. // ==================================================
  96. public sealed class CompanyConfig
  97. {
  98. public string? Name { get; set; }
  99. public string? RegNo { get; set; }
  100. public string? Address { get; set; }
  101. public string? ZipCode { get; set; }
  102. public string? Owner { get; set; }
  103. public string? Tel { get; set; }
  104. public string? Fax { get; set; }
  105. public string? RetailSaleNo { get; set; }
  106. public string? AddedSaleNo { get; set; }
  107. public string? Hosting { get; set; }
  108. public string? AdminName { get; set; }
  109. public string? AdminEmail { get; set; }
  110. public string? SiteUrl { get; set; }
  111. public string? BankCode { get; set; }
  112. public string? BankOwner { get; set; }
  113. public string? BankNumber { get; set; }
  114. }
  115. // ==================================================
  116. // 회원가입 설정 (Account)
  117. // ==================================================
  118. public sealed class AccountConfig
  119. {
  120. // 회원 가입 시
  121. public bool IsRegisterBlock { get; set; } = false;
  122. public bool IsRegisterEmailAuth { get; set; } = false;
  123. public ushort? PasswordMinLength { get; set; }
  124. public ushort? PasswordUppercaseLength { get; set; }
  125. public ushort? PasswordNumbersLength { get; set; }
  126. public ushort? PasswordSpecialcharsLength { get; set; }
  127. public string? DeniedEmailList { get; set; }
  128. public string? DeniedNameList { get; set; }
  129. // 회원 수정 시
  130. public ushort? ChangeEmailDay { get; set; }
  131. public ushort? ChangeNameDay { get; set; }
  132. public ushort? ChangeSummaryDay { get; set; }
  133. public ushort? ChangeIntroDay { get; set; }
  134. public ushort? ChangePasswordDay { get; set; }
  135. // 로그인 시
  136. public ushort? MaxLoginTryCount { get; set; }
  137. public ushort? MaxLoginTryLimitSecond { get; set; }
  138. }
  139. // ==================================================
  140. // 알림 발송 양식 - 이메일 (EmailTemplate)
  141. // ==================================================
  142. public sealed class EmailTemplateConfig
  143. {
  144. public string? RegisterEmailFormTitle { get; set; }
  145. public string? RegisterEmailFormContent { get; set; }
  146. public string? RegistrationEmailFormTitle { get; set; }
  147. public string? RegistrationEmailFormContent { get; set; }
  148. public string? ResetPasswordEmailFormTitle { get; set; }
  149. public string? ResetPasswordEmailFormContent { get; set; }
  150. public string? ChangedPasswordEmailFormTitle { get; set; }
  151. public string? ChangedPasswordEmailFormContent { get; set; }
  152. public string? WithdrawEmailFormTitle { get; set; }
  153. public string? WithdrawEmailFormContent { get; set; }
  154. public string? EmailVerifyFormTitle { get; set; }
  155. public string? EmailVerifyFormContent { get; set; }
  156. public string? ChangedEmailFormTitle { get; set; }
  157. public string? ChangedEmailFormContent { get; set; }
  158. }
  159. // ==================================================
  160. // 외부 API 설정 (External)
  161. // ==================================================
  162. public sealed class ExternalApiConfig
  163. {
  164. /** YouTube **/
  165. public string? YouTubeApiKeyEnc { get; set; }
  166. public string? YouTubeApiName { get; set; }
  167. /** 구글 **/
  168. public string? GoogleClientId { get; set; }
  169. public string? GoogleClientSecretEnc { get; set; }
  170. public string? GoogleAppId { get; set; }
  171. /** 다날 페이 **/
  172. //[Comment("Danal 결제 환경")]
  173. //public string? DanalPayMode { get; set; }
  174. //[Comment("Danal Test CPID")]
  175. //public string? DanalTestCpid { get; set; }
  176. //[Comment("Danal Test Client Key (암호화 저장 권장)")]
  177. //public string? DanalTestClientKeyEnc { get; set; }
  178. //[Comment("Danal Test Secret Key (암호화 저장 권장)")]
  179. //public string? DanalTestSecretKeyEnc { get; set; }
  180. //[Comment("Danal Live CPID")]
  181. //public string? DanalLiveCpid { get; set; }
  182. //[Comment("Danal Live Client Key (암호화 저장 권장)")]
  183. //public string? DanalLiveClientKeyEnc { get; set; }
  184. //[Comment("Danal Live Secret Key (암호화 저장 권장)")]
  185. //public string? DanalLiveSecretKeyEnc { get; set; }
  186. }
  187. // ==================================================
  188. // 결제 설정 (Payment)
  189. // ==================================================
  190. public sealed class PaymentConfig
  191. {
  192. /** 다날 페이 **/
  193. //[Range(0, 100)]
  194. //[Comment("다날 신용카드 수수료(%)")]
  195. //public decimal? DanalCardFeeRate { get; set; }
  196. //[Range(0, 999_999_999)]
  197. //[Comment("다날 신용카드 수수료(원)")]
  198. //public decimal? DanalCardFeeAmount { get; set; }
  199. //[Range(0, 100)]
  200. //[Comment("다날 계좌이체 수수료(%)")]
  201. //public decimal? DanalTransferFeeRate { get; set; }
  202. //[Range(0, 999_999_999)]
  203. //[Comment("다날 계좌이체 수수료(원)")]
  204. //public decimal? DanalTransferFeeAmount { get; set; }
  205. //[Range(0, 100)]
  206. //[Comment("다날 가상계좌 수수료(%)")]
  207. //public decimal? DanalVbankFeeRate { get; set; }
  208. //[Range(0, 999_999_999)]
  209. //[Comment("다날 가상계좌 수수료(원)")]
  210. //public decimal? DanalVbankFeeAmount { get; set; }
  211. //[Range(0, 100)]
  212. //[Comment("다날 간편결제 수수료(%)")]
  213. //public decimal? DanalSimpleFeeRate { get; set; }
  214. //[Range(0, 999_999_999)]
  215. //[Comment("다날 간편결제 수수료(원)")]
  216. //public decimal? DanalSimpleFeeAmount { get; set; }
  217. }
  218. #endregion
  219. }