Request.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. using Microsoft.AspNetCore.Http;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. namespace Application.Features.Config.Update;
  5. public sealed class Request
  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. // �⺻ ����
  17. public sealed class BasicConfigDto
  18. {
  19. [MaxLength(100)]
  20. [DisplayName("����Ʈ �̸�")]
  21. public string? SiteName { get; init; }
  22. [MaxLength(100)]
  23. [DataType(DataType.Url)]
  24. [DisplayName("����Ʈ �ּ�")]
  25. public string? SiteURL { get; init; }
  26. [DisplayName("�ְ� ������ ID")]
  27. public string? RootID { get; init; }
  28. [MaxLength(100)]
  29. [DataType(DataType.EmailAddress)]
  30. [DisplayName("�ۼ��� �̸���")]
  31. public string? FromEmail { get; init; }
  32. [MaxLength(30)]
  33. [DisplayName("�ۼ����� �̸�")]
  34. public string? FromName { get; init; }
  35. [MaxLength(200)]
  36. [DisplayName("SMTP Server")]
  37. public string? SmtpServer { get; init; }
  38. [Range(1, 65535)]
  39. [DisplayName("SMTP Port")]
  40. public int? SmtpPort { get; set; }
  41. [DisplayName("SMTP Enable SSL")]
  42. public bool SmtpEnableSSL { get; init; } = false;
  43. [MaxLength(100)]
  44. [DisplayName("SMTP Username")]
  45. public string? SmtpUsername { get; init; }
  46. [MaxLength(200)]
  47. [DataType(DataType.Password)]
  48. [DisplayName("SMTP Password")]
  49. public string? SmtpPassword { get; init; }
  50. [MaxLength(200)]
  51. [DataType(DataType.MultilineText)]
  52. [DisplayName("�����ڴ� ���� ���� IP")]
  53. public string? AdminWhiteIPList { get; init; }
  54. [MaxLength(200)]
  55. [DataType(DataType.MultilineText)]
  56. [DisplayName("����ڴ� ���� ���� IP")]
  57. public string? FrontWhiteIPList { get; init; }
  58. [MaxLength(200)]
  59. [DisplayName("���� �� �ȳ��� ����")]
  60. public string? BlockAlertTitle { get; init; }
  61. [MaxLength(5000)]
  62. [DataType(DataType.MultilineText)]
  63. [DisplayName("���� �� �ȳ��� ����")]
  64. public string? BlockAlertContent { get; init; }
  65. [DisplayName("���� ����")]
  66. public bool IsMaintenance { get; init; } = false;
  67. [MaxLength(5000)]
  68. [DataType(DataType.MultilineText)]
  69. [DisplayName("���� ����")]
  70. public string? MaintenanceContent { get; init; }
  71. }
  72. // �̹��� ��� �� ���ε� �Է�
  73. public sealed class ImagesConfigDto
  74. {
  75. // ====== DB�� ����/ǥ���� ���(���ڿ�) ======
  76. [MaxLength(255)]
  77. [DisplayName("Favicon")]
  78. public string? FaviconPath { get; init; }
  79. [MaxLength(255)]
  80. [DisplayName("Logo-square")]
  81. public string? LogoSquarePath { get; init; }
  82. [MaxLength(255)]
  83. [DisplayName("Logo-horizontal")]
  84. public string? LogoHorizontalPath { get; init; }
  85. [MaxLength(255)]
  86. [DisplayName("og-default")]
  87. public string? OgDefaultPath { get; init; }
  88. [MaxLength(255)]
  89. [DisplayName("Twitter-image")]
  90. public string? TwitterImagePath { get; init; }
  91. [MaxLength(255)]
  92. [DisplayName("Apple-touch-icon")]
  93. public string? AppleTouchIconPath { get; init; }
  94. [MaxLength(255)]
  95. [DisplayName("App-icon-192")]
  96. public string? AppIcon192Path { get; init; }
  97. [MaxLength(255)]
  98. [DisplayName("App-icon-512")]
  99. public string? AppIcon512Path { get; init; }
  100. // ====== ���ε� �Է�(�� ���ε���) ======
  101. [DataType(DataType.Upload)]
  102. [DisplayName("Favicon ���ε�")]
  103. public IFormFile? FaviconFile { get; init; }
  104. [DataType(DataType.Upload)]
  105. [DisplayName("Logo-square ���ε�")]
  106. public IFormFile? LogoSquareFile { get; init; }
  107. [DataType(DataType.Upload)]
  108. [DisplayName("Logo-horizontal ���ε�")]
  109. public IFormFile? LogoHorizontalFile { get; init; }
  110. [DataType(DataType.Upload)]
  111. [DisplayName("og-default ���ε�")]
  112. public IFormFile? OgDefaultFile { get; init; }
  113. [DataType(DataType.Upload)]
  114. [DisplayName("Twitter-image ���ε�")]
  115. public IFormFile? TwitterImageFile { get; init; }
  116. [DataType(DataType.Upload)]
  117. [DisplayName("Apple-touch-icon ���ε�")]
  118. public IFormFile? AppleTouchIconFile { get; init; }
  119. [DataType(DataType.Upload)]
  120. [DisplayName("App-icon-192 ���ε�")]
  121. public IFormFile? AppIcon192File { get; init; }
  122. [DataType(DataType.Upload)]
  123. [DisplayName("App-icon-512 ���ε�")]
  124. public IFormFile? AppIcon512File { get; init; }
  125. }
  126. // ��Ÿ �±�
  127. public sealed class MetaConfigDto
  128. {
  129. [MaxLength(255)]
  130. [DisplayName("Meta Keywords")]
  131. public string? Keywords { get; init; }
  132. [MaxLength(255)]
  133. [DisplayName("Meta Description")]
  134. public string? Description { get; init; }
  135. [MaxLength(255)]
  136. [DisplayName("Meta Author")]
  137. public string? Author { get; init; }
  138. [MaxLength(255)]
  139. [DisplayName("Meta Viewport")]
  140. public string? Viewport { get; init; }
  141. [MaxLength(255)]
  142. [DisplayName("Meta ApplicationName")]
  143. public string? ApplicationName { get; init; }
  144. [MaxLength(255)]
  145. [DisplayName("Meta Generator")]
  146. public string? Generator { get; init; }
  147. [MaxLength(255)]
  148. [DisplayName("Meta Robots")]
  149. public string? Robots { get; init; }
  150. [MaxLength(3000)]
  151. [DataType(DataType.MultilineText)]
  152. [DisplayName("Meta Adds")]
  153. public string? Adds { get; init; }
  154. }
  155. // ȸ�� ����
  156. public sealed class CompanyConfigDto
  157. {
  158. [MaxLength(70)]
  159. [DisplayName("��ȣ ��")]
  160. public string? Name { get; init; }
  161. [MaxLength(100)]
  162. [DisplayName("����� ��� ��ȣ")]
  163. public string? RegNo { get; init; }
  164. [MaxLength(255)]
  165. [DisplayName("����� ������")]
  166. public string? Address { get; init; }
  167. [MaxLength(8)]
  168. [DataType(DataType.PostalCode)]
  169. [DisplayName("������ȣ")]
  170. public string? ZipCode { get; init; }
  171. [MaxLength(50)]
  172. [DisplayName("��ǥ�� ��")]
  173. public string? Owner { get; init; }
  174. [MaxLength(20)]
  175. [DisplayName("��ǥ ��ȭ��ȣ")]
  176. public string? Tel { get; init; }
  177. [MaxLength(20)]
  178. [DisplayName("FAX")]
  179. public string? Fax { get; init; }
  180. [MaxLength(20)]
  181. [DisplayName("����Ǹž� �Ű���ȣ")]
  182. public string? RetailSaleNo { get; init; }
  183. [MaxLength(20)]
  184. [DisplayName("�ΰ���� ����ڹ�ȣ")]
  185. public string? AddedSaleNo { get; init; }
  186. [MaxLength(100)]
  187. [DisplayName("ȣ���� ����")]
  188. public string? Hosting { get; init; }
  189. [MaxLength(70)]
  190. [DisplayName("�����������")]
  191. public string? AdminName { get; init; }
  192. [MaxLength(100)]
  193. [DataType(DataType.EmailAddress)]
  194. [DisplayName("��������å���� �̸���")]
  195. public string? AdminEmail { get; init; }
  196. [MaxLength(200)]
  197. [DataType(DataType.Url)]
  198. [DisplayName("����Ʈ �ּ�")]
  199. public string? SiteUrl { get; init; }
  200. [MaxLength(10)]
  201. [DisplayName("�Աݰ��� - ����")]
  202. public string? BankCode { get; init; }
  203. [MaxLength(70)]
  204. [DisplayName("�Աݰ��� - ������")]
  205. public string? BankOwner { get; init; }
  206. [MaxLength(100)]
  207. [DisplayName("�Աݰ��� - ���¹�ȣ")]
  208. public string? BankNumber { get; init; }
  209. }
  210. // ȸ�� ����
  211. public sealed class AccountConfigDto
  212. {
  213. [DisplayName("ȸ������ �� - ���� ����")]
  214. public bool IsRegisterBlock { get; init; } = false;
  215. [DisplayName("ȸ������ �� - �̸��� ���� ����")]
  216. public bool IsRegisterEmailAuth { get; init; } = false;
  217. [Range(0, 100)]
  218. [DisplayName("ȸ������ �� - ��й�ȣ �ּ� ����")]
  219. public ushort? PasswordMinLength { get; init; }
  220. [Range(0, 100)]
  221. [DisplayName("ȸ������ �� - ��й�ȣ �빮�� �ּ� ����")]
  222. public ushort? PasswordUppercaseLength { get; init; }
  223. [Range(0, 100)]
  224. [DisplayName("ȸ������ �� - ��й�ȣ ���� �ּ� ����")]
  225. public ushort? PasswordNumbersLength { get; init; }
  226. [Range(0, 100)]
  227. [DisplayName("ȸ������ �� - ��й�ȣ Ư������ �ּ� ����")]
  228. public ushort? PasswordSpecialcharsLength { get; init; }
  229. [MaxLength(4000)]
  230. [DisplayName("ȸ������ �� - ���� �̸���")]
  231. public string? DeniedEmailList { get; init; }
  232. [MaxLength(4000)]
  233. [DisplayName("ȸ������ �� - ���� ����")]
  234. public string? DeniedNameList { get; init; }
  235. [Range(0, 365)]
  236. [DisplayName("ȸ������ �� - �̸��� ���� �ֱ�")]
  237. public ushort? ChangeEmailDay { get; init; }
  238. [Range(0, 365)]
  239. [DisplayName("ȸ������ �� - �̸� ���� �ֱ�")]
  240. public ushort? ChangeNameDay { get; init; }
  241. [Range(0, 365)]
  242. [DisplayName("ȸ������ �� - �Ұ� ���� �ֱ�")]
  243. public ushort? ChangeSummaryDay { get; init; }
  244. [Range(0, 365)]
  245. [DisplayName("ȸ������ �� - �ڱ�Ұ� ���� �ֱ�")]
  246. public ushort? ChangeIntroDay { get; init; }
  247. [Range(0, 365)]
  248. [DisplayName("ȸ������ �� - ��й�ȣ ���� �ֱ�")]
  249. public ushort? ChangePasswordDay { get; init; }
  250. [DisplayName("�α��� �� - �̸��� ���� �ʿ�")]
  251. public bool IsLoginEmailVerifiedOnly { get; init; } = false;
  252. [Range(0, 100)]
  253. [DisplayName("�α��� �� - �α��� �õ�(ȸ)")]
  254. public ushort? MaxLoginTryCount { get; init; }
  255. [Range(0, 86400)]
  256. [DisplayName("��� �� - ��� ����(��)")]
  257. public ushort? MaxLoginTryLimitSecond { get; init; }
  258. }
  259. // �˸� �߼� ���
  260. public sealed class EmailTemplateConfigDto
  261. {
  262. [MaxLength(4000)]
  263. [DisplayName("ȸ������ �� - ����")]
  264. public string? RegisterEmailFormTitle { get; init; }
  265. [MaxLength(4000)]
  266. [DisplayName("ȸ������ �� - ����")]
  267. public string? RegisterEmailFormContent { get; init; }
  268. [MaxLength(4000)]
  269. [DisplayName("ȸ������ �Ϸ� - ����")]
  270. public string? RegistrationEmailFormTitle { get; init; }
  271. [MaxLength(4000)]
  272. [DisplayName("ȸ������ �Ϸ� - ����")]
  273. public string? RegistrationEmailFormContent { get; init; }
  274. [MaxLength(4000)]
  275. [DisplayName("��й�ȣ �缳�� - ����")]
  276. public string? ResetPasswordEmailFormTitle { get; init; }
  277. [MaxLength(4000)]
  278. [DisplayName("��й�ȣ �缳�� - ����")]
  279. public string? ResetPasswordEmailFormContent { get; init; }
  280. [MaxLength(4000)]
  281. [DisplayName("��й�ȣ ���� �Ϸ� - ����")]
  282. public string? ChangedPasswordEmailFormTitle { get; init; }
  283. [MaxLength(4000)]
  284. [DisplayName("��й�ȣ ���� �Ϸ� - ����")]
  285. public string? ChangedPasswordEmailFormContent { get; init; }
  286. [MaxLength(4000)]
  287. [DisplayName("ȸ��Ż�� �� - ����")]
  288. public string? WithdrawEmailFormTitle { get; init; }
  289. [MaxLength(4000)]
  290. [DisplayName("ȸ��Ż�� �� - ����")]
  291. public string? WithdrawEmailFormContent { get; init; }
  292. [MaxLength(4000)]
  293. [DisplayName("�̸��� ���� �� - ����")]
  294. public string? EmailVerifyFormTitle { get; init; }
  295. [MaxLength(4000)]
  296. [DisplayName("�̸��� ���� �� - ����")]
  297. public string? EmailVerifyFormContent { get; init; }
  298. [MaxLength(4000)]
  299. [DisplayName("�̸��� ���� �Ϸ� - ����")]
  300. public string? ChangedEmailFormTitle { get; init; }
  301. [MaxLength(4000)]
  302. [DisplayName("�̸��� ���� �Ϸ� - ����")]
  303. public string? ChangedEmailFormContent { get; init; }
  304. }
  305. // API ����
  306. public sealed class ExternalApiConfigDto
  307. {
  308. [MaxLength(500)]
  309. [DisplayName("YouTube - API Name")]
  310. public string? YouTubeApiKeyEnc { get; init; }
  311. [MaxLength(500)]
  312. [DisplayName("YouTube - API Key")]
  313. public string? YouTubeApiName { get; init; }
  314. [MaxLength(500)]
  315. [DisplayName("Google - Client ID")]
  316. public string? GoogleClientId { get; init; }
  317. [MaxLength(500)]
  318. [DisplayName("Google - Client Secret")]
  319. public string? GoogleClientSecretEnc { get; init; }
  320. [MaxLength(500)]
  321. [DisplayName("Google - App ID")]
  322. public string? GoogleAppId { get; init; }
  323. [DisplayName("다날 - 결제 환경")]
  324. public string? DanalPayMode { get; init; }
  325. [MaxLength(100)]
  326. [DisplayName("다날 - Test CPID")]
  327. public string? DanalTestCpid { get; init; }
  328. [MaxLength(500)]
  329. [DisplayName("다날 - Test Client Key")]
  330. public string? DanalTestClientKeyEnc { get; init; }
  331. [MaxLength(500)]
  332. [DisplayName("다날 - Test Secret Key")]
  333. public string? DanalTestSecretKeyEnc { get; init; }
  334. [MaxLength(100)]
  335. [DisplayName("다날 - Live CPID")]
  336. public string? DanalLiveCpid { get; init; }
  337. [MaxLength(500)]
  338. [DisplayName("다날 - Live Client Key")]
  339. public string? DanalLiveClientKeyEnc { get; init; }
  340. [MaxLength(500)]
  341. [DisplayName("다날 - Live Secret Key")]
  342. public string? DanalLiveSecretKeyEnc { get; init; }
  343. }
  344. public sealed class PaymentConfigDto
  345. {
  346. }
  347. public static Request From(Get.Response src) => new()
  348. {
  349. ID = src.ID,
  350. Basic = new BasicConfigDto
  351. {
  352. SiteName = src.Basic.SiteName,
  353. SiteURL = src.Basic.SiteURL,
  354. RootID = src.Basic.RootID,
  355. FromEmail = src.Basic.FromEmail,
  356. FromName = src.Basic.FromName,
  357. SmtpServer = src.Basic.SmtpServer,
  358. SmtpPort = src.Basic.SmtpPort,
  359. SmtpEnableSSL = src.Basic.SmtpEnableSSL,
  360. SmtpUsername = src.Basic.SmtpUsername,
  361. SmtpPassword = src.Basic.SmtpPassword,
  362. AdminWhiteIPList = src.Basic.AdminWhiteIPList,
  363. FrontWhiteIPList = src.Basic.FrontWhiteIPList,
  364. BlockAlertTitle = src.Basic.BlockAlertTitle,
  365. BlockAlertContent = src.Basic.BlockAlertContent,
  366. IsMaintenance = src.Basic.IsMaintenance,
  367. MaintenanceContent = src.Basic.MaintenanceContent
  368. },
  369. Images = new ImagesConfigDto
  370. {
  371. FaviconPath = src.Images.FaviconPath,
  372. LogoSquarePath = src.Images.LogoSquarePath,
  373. LogoHorizontalPath = src.Images.LogoHorizontalPath,
  374. OgDefaultPath = src.Images.OgDefaultPath,
  375. TwitterImagePath = src.Images.TwitterImagePath,
  376. AppleTouchIconPath = src.Images.AppleTouchIconPath,
  377. AppIcon192Path = src.Images.AppIcon192Path,
  378. AppIcon512Path = src.Images.AppIcon512Path
  379. },
  380. Meta = new MetaConfigDto
  381. {
  382. Keywords = src.Meta.Keywords,
  383. Description = src.Meta.Description,
  384. Author = src.Meta.Author,
  385. Viewport = src.Meta.Viewport,
  386. ApplicationName = src.Meta.ApplicationName,
  387. Generator = src.Meta.Generator,
  388. Robots = src.Meta.Robots,
  389. Adds = src.Meta.Adds
  390. },
  391. Company = new CompanyConfigDto
  392. {
  393. Name = src.Company.Name,
  394. RegNo = src.Company.RegNo,
  395. Address = src.Company.Address,
  396. ZipCode = src.Company.ZipCode,
  397. Owner = src.Company.Owner,
  398. Tel = src.Company.Tel,
  399. Fax = src.Company.Fax,
  400. RetailSaleNo = src.Company.RetailSaleNo,
  401. AddedSaleNo = src.Company.AddedSaleNo,
  402. Hosting = src.Company.Hosting,
  403. AdminName = src.Company.AdminName,
  404. AdminEmail = src.Company.AdminEmail,
  405. SiteUrl = src.Company.SiteUrl,
  406. BankCode = src.Company.BankCode,
  407. BankOwner = src.Company.BankOwner,
  408. BankNumber = src.Company.BankNumber
  409. },
  410. Account = new AccountConfigDto
  411. {
  412. IsRegisterBlock = src.Account.IsRegisterBlock,
  413. IsRegisterEmailAuth = src.Account.IsRegisterEmailAuth,
  414. PasswordMinLength = src.Account.PasswordMinLength,
  415. PasswordUppercaseLength = src.Account.PasswordUppercaseLength,
  416. PasswordNumbersLength = src.Account.PasswordNumbersLength,
  417. PasswordSpecialcharsLength = src.Account.PasswordSpecialcharsLength,
  418. DeniedEmailList = src.Account.DeniedEmailList,
  419. DeniedNameList = src.Account.DeniedNameList,
  420. ChangeEmailDay = src.Account.ChangeEmailDay,
  421. ChangeNameDay = src.Account.ChangeNameDay,
  422. ChangeSummaryDay = src.Account.ChangeSummaryDay,
  423. ChangeIntroDay = src.Account.ChangeIntroDay,
  424. ChangePasswordDay = src.Account.ChangePasswordDay,
  425. IsLoginEmailVerifiedOnly = src.Account.IsLoginEmailVerifiedOnly,
  426. MaxLoginTryCount = src.Account.MaxLoginTryCount,
  427. MaxLoginTryLimitSecond = src.Account.MaxLoginTryLimitSecond
  428. },
  429. EmailTemplate = new EmailTemplateConfigDto
  430. {
  431. RegisterEmailFormTitle = src.EmailTemplate.RegisterEmailFormTitle,
  432. RegisterEmailFormContent = src.EmailTemplate.RegisterEmailFormContent,
  433. RegistrationEmailFormTitle = src.EmailTemplate.RegistrationEmailFormTitle,
  434. RegistrationEmailFormContent = src.EmailTemplate.RegistrationEmailFormContent,
  435. ResetPasswordEmailFormTitle = src.EmailTemplate.ResetPasswordEmailFormTitle,
  436. ResetPasswordEmailFormContent = src.EmailTemplate.ResetPasswordEmailFormContent,
  437. ChangedPasswordEmailFormTitle = src.EmailTemplate.ChangedPasswordEmailFormTitle,
  438. ChangedPasswordEmailFormContent = src.EmailTemplate.ChangedPasswordEmailFormContent,
  439. WithdrawEmailFormTitle = src.EmailTemplate.WithdrawEmailFormTitle,
  440. WithdrawEmailFormContent = src.EmailTemplate.WithdrawEmailFormContent,
  441. EmailVerifyFormTitle = src.EmailTemplate.EmailVerifyFormTitle,
  442. EmailVerifyFormContent = src.EmailTemplate.EmailVerifyFormContent,
  443. ChangedEmailFormTitle = src.EmailTemplate.ChangedEmailFormTitle,
  444. ChangedEmailFormContent = src.EmailTemplate.ChangedEmailFormContent
  445. },
  446. External = new ExternalApiConfigDto
  447. {
  448. YouTubeApiKeyEnc = src.External.YouTubeApiKeyEnc,
  449. YouTubeApiName = src.External.YouTubeApiName,
  450. GoogleClientId = src.External.GoogleClientId,
  451. GoogleClientSecretEnc = src.External.GoogleClientSecretEnc,
  452. GoogleAppId = src.External.GoogleAppId,
  453. DanalPayMode = src.External.DanalPayMode,
  454. DanalTestCpid = src.External.DanalTestCpid,
  455. DanalTestClientKeyEnc = src.External.DanalTestClientKeyEnc,
  456. DanalTestSecretKeyEnc = src.External.DanalTestSecretKeyEnc,
  457. DanalLiveCpid = src.External.DanalLiveCpid,
  458. DanalLiveClientKeyEnc = src.External.DanalLiveClientKeyEnc,
  459. DanalLiveSecretKeyEnc = src.External.DanalLiveSecretKeyEnc
  460. },
  461. Payment = new PaymentConfigDto()
  462. };
  463. }