ConfigDto.cs 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. using Microsoft.AspNetCore.Http;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. namespace Application.Features.Config;
  5. public sealed class ConfigDto
  6. {
  7. public int ID { get; init; }
  8. public BasicConfigDto Basic { get; init; } = new();
  9. public ImagesConfigDto Images { get; init; } = new();
  10. public MetaConfigDto Meta { get; init; } = new();
  11. public CompanyConfigDto Company { get; init; } = new();
  12. public AccountConfigDto Account { get; init; } = new();
  13. public EmailTemplateConfigDto EmailTemplate { get; init; } = new();
  14. public ExternalApiConfigDto External { get; init; } = new();
  15. public PaymentConfigDto Payment { get; init; } = new();
  16. public sealed class BasicConfigDto
  17. {
  18. [MaxLength(100)]
  19. [DisplayName("사이트 이름")]
  20. public string? SiteName { get; init; }
  21. [MaxLength(100)]
  22. [DataType(DataType.Url)]
  23. [DisplayName("사이트 주소")]
  24. public string? SiteURL { get; init; }
  25. [DisplayName("최고 관리자 ID")]
  26. public string? RootID { get; init; }
  27. [MaxLength(100)]
  28. [DataType(DataType.EmailAddress)]
  29. [DisplayName("송수신 이메일")]
  30. public string? FromEmail { get; init; }
  31. [MaxLength(30)]
  32. [DisplayName("송수신자 이름")]
  33. public string? FromName { get; init; }
  34. [MaxLength(200)]
  35. [DisplayName("SMTP Server")]
  36. public string? SmtpServer { get; init; }
  37. [Range(1, 65535)]
  38. [DisplayName("SMTP Port")]
  39. public int? SmtpPort { get; set; }
  40. [DisplayName("SMTP Enable SSL")]
  41. public bool SmtpEnableSSL { get; init; } = false;
  42. [MaxLength(100)]
  43. [DisplayName("SMTP Username")]
  44. public string? SmtpUsername { get; init; }
  45. [MaxLength(200)]
  46. [DataType(DataType.Password)]
  47. [DisplayName("SMTP Password")]
  48. public string? SmtpPassword { get; init; }
  49. [MaxLength(200)]
  50. [DataType(DataType.MultilineText)]
  51. [DisplayName("관리자단 접근 가능 IP")]
  52. public string? AdminWhiteIPList { get; init; }
  53. [MaxLength(200)]
  54. [DataType(DataType.MultilineText)]
  55. [DisplayName("사용자단 접근 가능 IP")]
  56. public string? FrontWhiteIPList { get; init; }
  57. [MaxLength(200)]
  58. [DisplayName("차단 시 안내문 제목")]
  59. public string? BlockAlertTitle { get; init; }
  60. [MaxLength(5000)]
  61. [DataType(DataType.MultilineText)]
  62. [DisplayName("차단 시 안내문 내용")]
  63. public string? BlockAlertContent { get; init; }
  64. [DisplayName("점검 여부")]
  65. public bool IsMaintenance { get; init; } = false;
  66. [MaxLength(5000)]
  67. [DataType(DataType.MultilineText)]
  68. [DisplayName("점검 내용")]
  69. public string? MaintenanceContent { get; init; }
  70. }
  71. public sealed class ImagesConfigDto
  72. {
  73. // ====== DB에 저장/표시할 경로(문자열) ======
  74. [MaxLength(255)]
  75. [DisplayName("Favicon")]
  76. public string? FaviconPath { get; init; }
  77. [MaxLength(255)]
  78. [DisplayName("Logo-square")]
  79. public string? LogoSquarePath { get; init; }
  80. [MaxLength(255)]
  81. [DisplayName("Logo-horizontal")]
  82. public string? LogoHorizontalPath { get; init; }
  83. [MaxLength(255)]
  84. [DisplayName("og-default")]
  85. public string? OgDefaultPath { get; init; }
  86. [MaxLength(255)]
  87. [DisplayName("Twitter-image")]
  88. public string? TwitterImagePath { get; init; }
  89. [MaxLength(255)]
  90. [DisplayName("Apple-touch-icon")]
  91. public string? AppleTouchIconPath { get; init; }
  92. [MaxLength(255)]
  93. [DisplayName("App-icon-192")]
  94. public string? AppIcon192Path { get; init; }
  95. [MaxLength(255)]
  96. [DisplayName("App-icon-512")]
  97. public string? AppIcon512Path { get; init; }
  98. // ====== 업로드 입력(폼 바인딩용) ======
  99. [DataType(DataType.Upload)]
  100. [DisplayName("Favicon 업로드")]
  101. public IFormFile? FaviconFile { get; init; }
  102. [DataType(DataType.Upload)]
  103. [DisplayName("Logo-square 업로드")]
  104. public IFormFile? LogoSquareFile { get; init; }
  105. [DataType(DataType.Upload)]
  106. [DisplayName("Logo-horizontal 업로드")]
  107. public IFormFile? LogoHorizontalFile { get; init; }
  108. [DataType(DataType.Upload)]
  109. [DisplayName("og-default 업로드")]
  110. public IFormFile? OgDefaultFile { get; init; }
  111. [DataType(DataType.Upload)]
  112. [DisplayName("Twitter-image 업로드")]
  113. public IFormFile? TwitterImageFile { get; init; }
  114. [DataType(DataType.Upload)]
  115. [DisplayName("Apple-touch-icon 업로드")]
  116. public IFormFile? AppleTouchIconFile { get; init; }
  117. [DataType(DataType.Upload)]
  118. [DisplayName("App-icon-192 업로드")]
  119. public IFormFile? AppIcon192File { get; init; }
  120. [DataType(DataType.Upload)]
  121. [DisplayName("App-icon-512 업로드")]
  122. public IFormFile? AppIcon512File { get; init; }
  123. }
  124. public sealed class MetaConfigDto
  125. {
  126. [MaxLength(255)]
  127. [DisplayName("Meta Keywords")]
  128. public string? Keywords { get; init; }
  129. [MaxLength(255)]
  130. [DisplayName("Meta Description")]
  131. public string? Description { get; init; }
  132. [MaxLength(255)]
  133. [DisplayName("Meta Author")]
  134. public string? Author { get; init; }
  135. [MaxLength(255)]
  136. [DisplayName("Meta Viewport")]
  137. public string? Viewport { get; init; }
  138. [MaxLength(255)]
  139. [DisplayName("Meta ApplicationName")]
  140. public string? ApplicationName { get; init; }
  141. [MaxLength(255)]
  142. [DisplayName("Meta Generator")]
  143. public string? Generator { get; init; }
  144. [MaxLength(255)]
  145. [DisplayName("Meta Robots")]
  146. public string? Robots { get; init; }
  147. [MaxLength(3000)]
  148. [DataType(DataType.MultilineText)]
  149. [DisplayName("Meta Adds")]
  150. public string? Adds { get; init; }
  151. }
  152. public sealed class CompanyConfigDto
  153. {
  154. [MaxLength(70)]
  155. [DisplayName("상호 명")]
  156. public string? Name { get; init; }
  157. [MaxLength(100)]
  158. [DisplayName("사업자 등록 번호")]
  159. public string? RegNo { get; init; }
  160. [MaxLength(255)]
  161. [DisplayName("사업자 소재지")]
  162. public string? Address { get; init; }
  163. [MaxLength(8)]
  164. [DataType(DataType.PostalCode)]
  165. [DisplayName("우편번호")]
  166. public string? ZipCode { get; init; }
  167. [MaxLength(50)]
  168. [DisplayName("대표자 명")]
  169. public string? Owner { get; init; }
  170. [MaxLength(20)]
  171. [DisplayName("대표 전화번호")]
  172. public string? Tel { get; init; }
  173. [MaxLength(20)]
  174. [DisplayName("FAX")]
  175. public string? Fax { get; init; }
  176. [MaxLength(20)]
  177. [DisplayName("통신판매업 신고번호")]
  178. public string? RetailSaleNo { get; init; }
  179. [MaxLength(20)]
  180. [DisplayName("부가통신 사업자번호")]
  181. public string? AddedSaleNo { get; init; }
  182. [MaxLength(100)]
  183. [DisplayName("호스팅 서비스")]
  184. public string? Hosting { get; init; }
  185. [MaxLength(70)]
  186. [DisplayName("정보관리책임자")]
  187. public string? AdminName { get; init; }
  188. [MaxLength(100)]
  189. [DataType(DataType.EmailAddress)]
  190. [DisplayName("정보관리책임자 이메일")]
  191. public string? AdminEmail { get; init; }
  192. [MaxLength(200)]
  193. [DataType(DataType.Url)]
  194. [DisplayName("사이트 주소")]
  195. public string? SiteUrl { get; init; }
  196. [MaxLength(10)]
  197. [DisplayName("입금계좌 - 은행")]
  198. public string? BankCode { get; init; }
  199. [MaxLength(70)]
  200. [DisplayName("입금계좌 - 예금주")]
  201. public string? BankOwner { get; init; }
  202. [MaxLength(100)]
  203. [DisplayName("입금계좌 - 계좌번호")]
  204. public string? BankNumber { get; init; }
  205. }
  206. public sealed class AccountConfigDto
  207. {
  208. public bool IsRegisterBlock { get; init; }
  209. public bool IsRegisterEmailAuth { get; init; }
  210. public ushort? PasswordMinLength { get; init; }
  211. public ushort? PasswordUppercaseLength { get; init; }
  212. public ushort? PasswordNumbersLength { get; init; }
  213. public ushort? PasswordSpecialcharsLength { get; init; }
  214. public string? DeniedEmailList { get; init; }
  215. public string? DeniedNameList { get; init; }
  216. public ushort? ChangeEmailDay { get; init; }
  217. public ushort? ChangeNameDay { get; init; }
  218. public ushort? ChangeSummaryDay { get; init; }
  219. public ushort? ChangeIntroDay { get; init; }
  220. public ushort? ChangePasswordDay { get; init; }
  221. public ushort? MaxLoginTryCount { get; init; }
  222. public ushort? MaxLoginTryLimitSecond { get; init; }
  223. }
  224. public sealed class EmailTemplateConfigDto
  225. {
  226. public string? RegisterEmailFormTitle { get; init; }
  227. public string? RegisterEmailFormContent { get; init; }
  228. public string? RegistrationEmailFormTitle { get; init; }
  229. public string? RegistrationEmailFormContent { get; init; }
  230. public string? ResetPasswordEmailFormTitle { get; init; }
  231. public string? ResetPasswordEmailFormContent { get; init; }
  232. public string? ChangedPasswordEmailFormTitle { get; init; }
  233. public string? ChangedPasswordEmailFormContent { get; init; }
  234. public string? WithdrawEmailFormTitle { get; init; }
  235. public string? WithdrawEmailFormContent { get; init; }
  236. public string? EmailVerifyFormTitle { get; init; }
  237. public string? EmailVerifyFormContent { get; init; }
  238. public string? ChangedEmailFormTitle { get; init; }
  239. public string? ChangedEmailFormContent { get; init; }
  240. }
  241. public sealed class ExternalApiConfigDto
  242. {
  243. public string? YouTubeApiKeyEnc { get; init; }
  244. public string? YouTubeApiName { get; init; }
  245. public string? GoogleClientId { get; init; }
  246. public string? GoogleClientSecretEnc { get; init; }
  247. public string? GoogleAppId { get; init; }
  248. }
  249. public sealed class PaymentConfigDto
  250. {
  251. }
  252. }