| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541 |
- using Microsoft.AspNetCore.Http;
- using System.ComponentModel;
- using System.ComponentModel.DataAnnotations;
- namespace Application.Features.Config.Update;
- public sealed class Request
- {
- public int ID { get; init; }
- public BasicConfigDto Basic { get; init; } = new();
- public ImagesConfigDto Images { get; init; } = new();
- public MetaConfigDto Meta { get; init; } = new();
- public CompanyConfigDto Company { get; init; } = new();
- public AccountConfigDto Account { get; init; } = new();
- public EmailTemplateConfigDto EmailTemplate { get; init; } = new();
- public ExternalApiConfigDto External { get; init; } = new();
- public PaymentConfigDto Payment { get; init; } = new();
- // �⺻ ����
- public sealed class BasicConfigDto
- {
- [MaxLength(100)]
- [DisplayName("����Ʈ �̸�")]
- public string? SiteName { get; init; }
- [MaxLength(100)]
- [DataType(DataType.Url)]
- [DisplayName("����Ʈ �ּ�")]
- public string? SiteURL { get; init; }
- [DisplayName("�ְ� ������ ID")]
- public string? RootID { get; init; }
- [MaxLength(100)]
- [DataType(DataType.EmailAddress)]
- [DisplayName("�ۼ��� �̸���")]
- public string? FromEmail { get; init; }
- [MaxLength(30)]
- [DisplayName("�ۼ����� �̸�")]
- public string? FromName { get; init; }
- [MaxLength(200)]
- [DisplayName("SMTP Server")]
- public string? SmtpServer { get; init; }
- [Range(1, 65535)]
- [DisplayName("SMTP Port")]
- public int? SmtpPort { get; set; }
- [DisplayName("SMTP Enable SSL")]
- public bool SmtpEnableSSL { get; init; } = false;
- [MaxLength(100)]
- [DisplayName("SMTP Username")]
- public string? SmtpUsername { get; init; }
- [MaxLength(200)]
- [DataType(DataType.Password)]
- [DisplayName("SMTP Password")]
- public string? SmtpPassword { get; init; }
- [MaxLength(200)]
- [DataType(DataType.MultilineText)]
- [DisplayName("�����ڴ� ���� ���� IP")]
- public string? AdminWhiteIPList { get; init; }
- [MaxLength(200)]
- [DataType(DataType.MultilineText)]
- [DisplayName("����ڴ� ���� ���� IP")]
- public string? FrontWhiteIPList { get; init; }
- [MaxLength(200)]
- [DisplayName("���� �� �ȳ��� ����")]
- public string? BlockAlertTitle { get; init; }
- [MaxLength(5000)]
- [DataType(DataType.MultilineText)]
- [DisplayName("���� �� �ȳ��� ����")]
- public string? BlockAlertContent { get; init; }
- [DisplayName("���� ����")]
- public bool IsMaintenance { get; init; } = false;
- [MaxLength(5000)]
- [DataType(DataType.MultilineText)]
- [DisplayName("���� ����")]
- public string? MaintenanceContent { get; init; }
- }
- // �̹��� ��� �� ���ε� �Է�
- public sealed class ImagesConfigDto
- {
- // ====== DB�� ����/ǥ���� ���(���ڿ�) ======
- [MaxLength(255)]
- [DisplayName("Favicon")]
- public string? FaviconPath { get; init; }
- [MaxLength(255)]
- [DisplayName("Logo-square")]
- public string? LogoSquarePath { get; init; }
- [MaxLength(255)]
- [DisplayName("Logo-horizontal")]
- public string? LogoHorizontalPath { get; init; }
- [MaxLength(255)]
- [DisplayName("og-default")]
- public string? OgDefaultPath { get; init; }
- [MaxLength(255)]
- [DisplayName("Twitter-image")]
- public string? TwitterImagePath { get; init; }
- [MaxLength(255)]
- [DisplayName("Apple-touch-icon")]
- public string? AppleTouchIconPath { get; init; }
- [MaxLength(255)]
- [DisplayName("App-icon-192")]
- public string? AppIcon192Path { get; init; }
- [MaxLength(255)]
- [DisplayName("App-icon-512")]
- public string? AppIcon512Path { get; init; }
- // ====== ���ε� �Է�(�� ���ε���) ======
- [DataType(DataType.Upload)]
- [DisplayName("Favicon ���ε�")]
- public IFormFile? FaviconFile { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("Logo-square ���ε�")]
- public IFormFile? LogoSquareFile { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("Logo-horizontal ���ε�")]
- public IFormFile? LogoHorizontalFile { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("og-default ���ε�")]
- public IFormFile? OgDefaultFile { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("Twitter-image ���ε�")]
- public IFormFile? TwitterImageFile { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("Apple-touch-icon ���ε�")]
- public IFormFile? AppleTouchIconFile { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("App-icon-192 ���ε�")]
- public IFormFile? AppIcon192File { get; init; }
- [DataType(DataType.Upload)]
- [DisplayName("App-icon-512 ���ε�")]
- public IFormFile? AppIcon512File { get; init; }
- }
- // ��Ÿ �±�
- public sealed class MetaConfigDto
- {
- [MaxLength(255)]
- [DisplayName("Meta Keywords")]
- public string? Keywords { get; init; }
- [MaxLength(255)]
- [DisplayName("Meta Description")]
- public string? Description { get; init; }
- [MaxLength(255)]
- [DisplayName("Meta Author")]
- public string? Author { get; init; }
- [MaxLength(255)]
- [DisplayName("Meta Viewport")]
- public string? Viewport { get; init; }
- [MaxLength(255)]
- [DisplayName("Meta ApplicationName")]
- public string? ApplicationName { get; init; }
- [MaxLength(255)]
- [DisplayName("Meta Generator")]
- public string? Generator { get; init; }
- [MaxLength(255)]
- [DisplayName("Meta Robots")]
- public string? Robots { get; init; }
- [MaxLength(3000)]
- [DataType(DataType.MultilineText)]
- [DisplayName("Meta Adds")]
- public string? Adds { get; init; }
- }
- // ȸ�� ����
- public sealed class CompanyConfigDto
- {
- [MaxLength(70)]
- [DisplayName("��ȣ ��")]
- public string? Name { get; init; }
- [MaxLength(100)]
- [DisplayName("����� ��� ��ȣ")]
- public string? RegNo { get; init; }
- [MaxLength(255)]
- [DisplayName("����� ������")]
- public string? Address { get; init; }
- [MaxLength(8)]
- [DataType(DataType.PostalCode)]
- [DisplayName("������ȣ")]
- public string? ZipCode { get; init; }
- [MaxLength(50)]
- [DisplayName("��ǥ�� ��")]
- public string? Owner { get; init; }
- [MaxLength(20)]
- [DisplayName("��ǥ ��ȭ��ȣ")]
- public string? Tel { get; init; }
- [MaxLength(20)]
- [DisplayName("FAX")]
- public string? Fax { get; init; }
- [MaxLength(20)]
- [DisplayName("����Ǹž� �Ű���ȣ")]
- public string? RetailSaleNo { get; init; }
- [MaxLength(20)]
- [DisplayName("�ΰ���� ����ڹ�ȣ")]
- public string? AddedSaleNo { get; init; }
- [MaxLength(100)]
- [DisplayName("ȣ���� ����")]
- public string? Hosting { get; init; }
- [MaxLength(70)]
- [DisplayName("�����������")]
- public string? AdminName { get; init; }
- [MaxLength(100)]
- [DataType(DataType.EmailAddress)]
- [DisplayName("��������å���� �̸���")]
- public string? AdminEmail { get; init; }
- [MaxLength(200)]
- [DataType(DataType.Url)]
- [DisplayName("����Ʈ �ּ�")]
- public string? SiteUrl { get; init; }
- [MaxLength(10)]
- [DisplayName("�Աݰ��� - ����")]
- public string? BankCode { get; init; }
- [MaxLength(70)]
- [DisplayName("�Աݰ��� - ������")]
- public string? BankOwner { get; init; }
- [MaxLength(100)]
- [DisplayName("�Աݰ��� - ���¹�ȣ")]
- public string? BankNumber { get; init; }
- }
- // ȸ�� ����
- public sealed class AccountConfigDto
- {
- [DisplayName("ȸ������ �� - ���� ����")]
- public bool IsRegisterBlock { get; init; } = false;
- [DisplayName("ȸ������ �� - �̸��� ���� ����")]
- public bool IsRegisterEmailAuth { get; init; } = false;
- [Range(0, 100)]
- [DisplayName("ȸ������ �� - ��й�ȣ �ּ� ����")]
- public ushort? PasswordMinLength { get; init; }
- [Range(0, 100)]
- [DisplayName("ȸ������ �� - ��й�ȣ �빮�� �ּ� ����")]
- public ushort? PasswordUppercaseLength { get; init; }
- [Range(0, 100)]
- [DisplayName("ȸ������ �� - ��й�ȣ ���� �ּ� ����")]
- public ushort? PasswordNumbersLength { get; init; }
- [Range(0, 100)]
- [DisplayName("ȸ������ �� - ��й�ȣ Ư������ �ּ� ����")]
- public ushort? PasswordSpecialcharsLength { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ������ �� - ���� �̸���")]
- public string? DeniedEmailList { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ������ �� - ���� ����")]
- public string? DeniedNameList { get; init; }
- [Range(0, 365)]
- [DisplayName("ȸ������ �� - �̸��� ���� �ֱ�")]
- public ushort? ChangeEmailDay { get; init; }
- [Range(0, 365)]
- [DisplayName("ȸ������ �� - �̸� ���� �ֱ�")]
- public ushort? ChangeNameDay { get; init; }
- [Range(0, 365)]
- [DisplayName("ȸ������ �� - �Ұ� ���� �ֱ�")]
- public ushort? ChangeSummaryDay { get; init; }
- [Range(0, 365)]
- [DisplayName("ȸ������ �� - �ڱ�Ұ� ���� �ֱ�")]
- public ushort? ChangeIntroDay { get; init; }
- [Range(0, 365)]
- [DisplayName("ȸ������ �� - ��й�ȣ ���� �ֱ�")]
- public ushort? ChangePasswordDay { get; init; }
- [DisplayName("�α��� �� - �̸��� ���� �ʿ�")]
- public bool IsLoginEmailVerifiedOnly { get; init; } = false;
- [Range(0, 100)]
- [DisplayName("�α��� �� - �α��� �õ�(ȸ)")]
- public ushort? MaxLoginTryCount { get; init; }
- [Range(0, 86400)]
- [DisplayName("��� �� - ��� ����(��)")]
- public ushort? MaxLoginTryLimitSecond { get; init; }
- }
- // �˸� �� ���
- public sealed class EmailTemplateConfigDto
- {
- [MaxLength(4000)]
- [DisplayName("ȸ������ �� - ����")]
- public string? RegisterEmailFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ������ �� - ����")]
- public string? RegisterEmailFormContent { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ������ �Ϸ� - ����")]
- public string? RegistrationEmailFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ������ �Ϸ� - ����")]
- public string? RegistrationEmailFormContent { get; init; }
- [MaxLength(4000)]
- [DisplayName("��й�ȣ �缳�� - ����")]
- public string? ResetPasswordEmailFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("��й�ȣ �缳�� - ����")]
- public string? ResetPasswordEmailFormContent { get; init; }
- [MaxLength(4000)]
- [DisplayName("��й�ȣ ���� �Ϸ� - ����")]
- public string? ChangedPasswordEmailFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("��й�ȣ ���� �Ϸ� - ����")]
- public string? ChangedPasswordEmailFormContent { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ��Ż�� �� - ����")]
- public string? WithdrawEmailFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("ȸ��Ż�� �� - ����")]
- public string? WithdrawEmailFormContent { get; init; }
- [MaxLength(4000)]
- [DisplayName("�̸��� ���� �� - ����")]
- public string? EmailVerifyFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("�̸��� ���� �� - ����")]
- public string? EmailVerifyFormContent { get; init; }
- [MaxLength(4000)]
- [DisplayName("�̸��� ���� �Ϸ� - ����")]
- public string? ChangedEmailFormTitle { get; init; }
- [MaxLength(4000)]
- [DisplayName("�̸��� ���� �Ϸ� - ����")]
- public string? ChangedEmailFormContent { get; init; }
- }
- // API ����
- public sealed class ExternalApiConfigDto
- {
- [MaxLength(500)]
- [DisplayName("YouTube - API Name")]
- public string? YouTubeApiKeyEnc { get; init; }
- [MaxLength(500)]
- [DisplayName("YouTube - API Key")]
- public string? YouTubeApiName { get; init; }
- [MaxLength(500)]
- [DisplayName("Google - Client ID")]
- public string? GoogleClientId { get; init; }
- [MaxLength(500)]
- [DisplayName("Google - Client Secret")]
- public string? GoogleClientSecretEnc { get; init; }
- [MaxLength(500)]
- [DisplayName("Google - App ID")]
- public string? GoogleAppId { get; init; }
- }
- public sealed class PaymentConfigDto
- {
- }
- public static Request From(Get.Response src) => new()
- {
- ID = src.ID,
- Basic = new BasicConfigDto
- {
- SiteName = src.Basic.SiteName,
- SiteURL = src.Basic.SiteURL,
- RootID = src.Basic.RootID,
- FromEmail = src.Basic.FromEmail,
- FromName = src.Basic.FromName,
- SmtpServer = src.Basic.SmtpServer,
- SmtpPort = src.Basic.SmtpPort,
- SmtpEnableSSL = src.Basic.SmtpEnableSSL,
- SmtpUsername = src.Basic.SmtpUsername,
- SmtpPassword = src.Basic.SmtpPassword,
- AdminWhiteIPList = src.Basic.AdminWhiteIPList,
- FrontWhiteIPList = src.Basic.FrontWhiteIPList,
- BlockAlertTitle = src.Basic.BlockAlertTitle,
- BlockAlertContent = src.Basic.BlockAlertContent,
- IsMaintenance = src.Basic.IsMaintenance,
- MaintenanceContent = src.Basic.MaintenanceContent
- },
- Images = new ImagesConfigDto
- {
- FaviconPath = src.Images.FaviconPath,
- LogoSquarePath = src.Images.LogoSquarePath,
- LogoHorizontalPath = src.Images.LogoHorizontalPath,
- OgDefaultPath = src.Images.OgDefaultPath,
- TwitterImagePath = src.Images.TwitterImagePath,
- AppleTouchIconPath = src.Images.AppleTouchIconPath,
- AppIcon192Path = src.Images.AppIcon192Path,
- AppIcon512Path = src.Images.AppIcon512Path
- },
- Meta = new MetaConfigDto
- {
- Keywords = src.Meta.Keywords,
- Description = src.Meta.Description,
- Author = src.Meta.Author,
- Viewport = src.Meta.Viewport,
- ApplicationName = src.Meta.ApplicationName,
- Generator = src.Meta.Generator,
- Robots = src.Meta.Robots,
- Adds = src.Meta.Adds
- },
- Company = new CompanyConfigDto
- {
- Name = src.Company.Name,
- RegNo = src.Company.RegNo,
- Address = src.Company.Address,
- ZipCode = src.Company.ZipCode,
- Owner = src.Company.Owner,
- Tel = src.Company.Tel,
- Fax = src.Company.Fax,
- RetailSaleNo = src.Company.RetailSaleNo,
- AddedSaleNo = src.Company.AddedSaleNo,
- Hosting = src.Company.Hosting,
- AdminName = src.Company.AdminName,
- AdminEmail = src.Company.AdminEmail,
- SiteUrl = src.Company.SiteUrl,
- BankCode = src.Company.BankCode,
- BankOwner = src.Company.BankOwner,
- BankNumber = src.Company.BankNumber
- },
- Account = new AccountConfigDto
- {
- IsRegisterBlock = src.Account.IsRegisterBlock,
- IsRegisterEmailAuth = src.Account.IsRegisterEmailAuth,
- PasswordMinLength = src.Account.PasswordMinLength,
- PasswordUppercaseLength = src.Account.PasswordUppercaseLength,
- PasswordNumbersLength = src.Account.PasswordNumbersLength,
- PasswordSpecialcharsLength = src.Account.PasswordSpecialcharsLength,
- DeniedEmailList = src.Account.DeniedEmailList,
- DeniedNameList = src.Account.DeniedNameList,
- ChangeEmailDay = src.Account.ChangeEmailDay,
- ChangeNameDay = src.Account.ChangeNameDay,
- ChangeSummaryDay = src.Account.ChangeSummaryDay,
- ChangeIntroDay = src.Account.ChangeIntroDay,
- ChangePasswordDay = src.Account.ChangePasswordDay,
- IsLoginEmailVerifiedOnly = src.Account.IsLoginEmailVerifiedOnly,
- MaxLoginTryCount = src.Account.MaxLoginTryCount,
- MaxLoginTryLimitSecond = src.Account.MaxLoginTryLimitSecond
- },
- EmailTemplate = new EmailTemplateConfigDto
- {
- RegisterEmailFormTitle = src.EmailTemplate.RegisterEmailFormTitle,
- RegisterEmailFormContent = src.EmailTemplate.RegisterEmailFormContent,
- RegistrationEmailFormTitle = src.EmailTemplate.RegistrationEmailFormTitle,
- RegistrationEmailFormContent = src.EmailTemplate.RegistrationEmailFormContent,
- ResetPasswordEmailFormTitle = src.EmailTemplate.ResetPasswordEmailFormTitle,
- ResetPasswordEmailFormContent = src.EmailTemplate.ResetPasswordEmailFormContent,
- ChangedPasswordEmailFormTitle = src.EmailTemplate.ChangedPasswordEmailFormTitle,
- ChangedPasswordEmailFormContent = src.EmailTemplate.ChangedPasswordEmailFormContent,
- WithdrawEmailFormTitle = src.EmailTemplate.WithdrawEmailFormTitle,
- WithdrawEmailFormContent = src.EmailTemplate.WithdrawEmailFormContent,
- EmailVerifyFormTitle = src.EmailTemplate.EmailVerifyFormTitle,
- EmailVerifyFormContent = src.EmailTemplate.EmailVerifyFormContent,
- ChangedEmailFormTitle = src.EmailTemplate.ChangedEmailFormTitle,
- ChangedEmailFormContent = src.EmailTemplate.ChangedEmailFormContent
- },
- External = new ExternalApiConfigDto
- {
- YouTubeApiKeyEnc = src.External.YouTubeApiKeyEnc,
- YouTubeApiName = src.External.YouTubeApiName,
- GoogleClientId = src.External.GoogleClientId,
- GoogleClientSecretEnc = src.External.GoogleClientSecretEnc,
- GoogleAppId = src.External.GoogleAppId
- },
- Payment = new PaymentConfigDto()
- };
- }
|