| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332 |
- namespace Domain.Entities.Common;
- public sealed class Config
- {
- public int ID { get; private set; }
- public DateTime LastUpdatedAt { get; private set; } = DateTime.UtcNow;
- public byte[] RowVersion { get; private set; } = [];
- public BasicConfig Basic { get; private set; } = new();
- public ImagesConfig Images { get; private set; } = new();
- public MetaConfig Meta { get; private set; } = new();
- public CompanyConfig Company { get; private set; } = new();
- public AccountConfig Account { get; private set; } = new();
- public EmailTemplateConfig EmailTemplate { get; private set; } = new();
- public ExternalApiConfig External { get; private set; } = new();
- public PaymentConfig Payment { get; private set; } = new();
- public CryptoConfig Crypto { get; private set; } = new();
- public AttendanceConfig Attendance { get; private set; } = new();
- public ChatExpConfig ChatExp { get; private set; } = new();
- private Config() { }
- public static Config Create()
- {
- return new();
- }
- public void Update(
- BasicConfig basic,
- ImagesConfig images,
- MetaConfig meta,
- CompanyConfig company,
- AccountConfig account,
- EmailTemplateConfig emailTemplate,
- ExternalApiConfig external,
- PaymentConfig payment,
- CryptoConfig crypto,
- AttendanceConfig attendance
- ) {
- Basic = basic ?? throw new ArgumentNullException(nameof(basic));
- Images = images ?? throw new ArgumentNullException(nameof(images));
- Meta = meta ?? throw new ArgumentNullException(nameof(meta));
- Company = company ?? throw new ArgumentNullException(nameof(company));
- Account = account ?? throw new ArgumentNullException(nameof(account));
- EmailTemplate = emailTemplate ?? throw new ArgumentNullException(nameof(emailTemplate));
- External = external ?? throw new ArgumentNullException(nameof(external));
- Payment = payment ?? throw new ArgumentNullException(nameof(payment));
- Crypto = crypto ?? throw new ArgumentNullException(nameof(crypto));
- Attendance = attendance ?? throw new ArgumentNullException(nameof(attendance));
- LastUpdatedAt = DateTime.UtcNow;
- }
- public void UpdateChatExp(ChatExpConfig chatExp)
- {
- ChatExp = chatExp ?? throw new ArgumentNullException(nameof(chatExp));
- LastUpdatedAt = DateTime.UtcNow;
- }
- }
- #region Owned Groups
- // ==================================================
- // 기본 정보 (Basic)
- // ==================================================
- public sealed class BasicConfig
- {
- public string? SiteName { get; set; }
- public string? SiteURL { get; set; }
- public string? RootID { get; set; }
- public string? FromEmail { get; set; }
- public string? FromName { get; set; }
- public string? SmtpServer { get; set; }
- public int? SmtpPort { get; set; }
- public bool SmtpEnableSSL { get; set; }
- public string? SmtpUsername { get; set; }
- public string? SmtpPassword { get; set; }
- public string? AdminWhiteIPList { get; set; }
- public string? FrontWhiteIPList { get; set; }
- public string? BlockAlertTitle { get; set; }
- public string? BlockAlertContent { get; set; }
- public bool IsMaintenance { get; set; } = false;
- public string? MaintenanceContent { get; set; }
- /// <summary>쪽지 일일 발송 제한 (사용자 1인당 / 시스템 쪽지 제외). 0 = 발송 차단</summary>
- public int NoteDailySendLimit { get; set; } = 3;
- }
- // ==================================================
- // 기본 이미지 (Images)
- // ==================================================
- public sealed class ImagesConfig
- {
- public string? Favicon { get; set; }
- public string? LogoSquare { get; set; }
- public string? LogoHorizontal { get; set; }
- public string? OgDefault { get; set; }
- public string? TwitterImage { get; set; }
- public string? AppleTouchIcon { get; set; }
- public string? AppIcon_192 { get; set; }
- public string? AppIcon_512 { get; set; }
- }
- // ==================================================
- // 메타 태그 (Meta)
- // ==================================================
- public sealed class MetaConfig
- {
- public string? Keywords { get; set; }
- public string? Description { get; set; }
- public string? Author { get; set; }
- public string? Viewport { get; set; }
- public string? ApplicationName { get; set; }
- public string? Generator { get; set; }
- public string? Robots { get; set; }
- public string? Adds { get; set; }
- }
- // ==================================================
- // 회사 정보 (Company)
- // ==================================================
- public sealed class CompanyConfig
- {
- public string? Name { get; set; }
- public string? RegNo { get; set; }
- public string? Address { get; set; }
- public string? ZipCode { get; set; }
- public string? Owner { get; set; }
- public string? Tel { get; set; }
- public string? Fax { get; set; }
- public string? RetailSaleNo { get; set; }
- public string? AddedSaleNo { get; set; }
- public string? Hosting { get; set; }
- public string? AdminName { get; set; }
- public string? AdminEmail { get; set; }
- public string? SiteUrl { get; set; }
- public string? BankCode { get; set; }
- public string? BankOwner { get; set; }
- public string? BankNumber { get; set; }
- }
- // ==================================================
- // 회원가입 설정 (Account)
- // ==================================================
- public sealed class AccountConfig
- {
- // 회원 가입 시
- public bool IsRegisterBlock { get; set; } = false;
- public bool IsRegisterEmailAuth { get; set; } = false;
- public ushort? PasswordMinLength { get; set; }
- public ushort? PasswordUppercaseLength { get; set; }
- public ushort? PasswordNumbersLength { get; set; }
- public ushort? PasswordSpecialcharsLength { get; set; }
- public string? DeniedEmailList { get; set; }
- public string? DeniedNameList { get; set; }
- // 회원 수정 시
- public ushort? ChangeEmailDay { get; set; }
- public ushort? ChangeNameDay { get; set; }
- public ushort? ChangeSummaryDay { get; set; }
- public ushort? ChangeIntroDay { get; set; }
- public ushort? ChangePasswordDay { get; set; }
- // 로그인 시
- public bool IsLoginEmailVerifiedOnly { get; set; } = false;
- public ushort? MaxLoginTryCount { get; set; }
- public ushort? MaxLoginTryLimitSecond { get; set; }
- }
- // ==================================================
- // 알림 발송 양식 - 이메일 (EmailTemplate)
- // ==================================================
- public sealed class EmailTemplateConfig
- {
- public string? RegisterEmailFormTitle { get; set; }
- public string? RegisterEmailFormContent { get; set; }
- public string? RegistrationEmailFormTitle { get; set; }
- public string? RegistrationEmailFormContent { get; set; }
- public string? ResetPasswordEmailFormTitle { get; set; }
- public string? ResetPasswordEmailFormContent { get; set; }
- public string? ChangedPasswordEmailFormTitle { get; set; }
- public string? ChangedPasswordEmailFormContent { get; set; }
- public string? WithdrawEmailFormTitle { get; set; }
- public string? WithdrawEmailFormContent { get; set; }
- public string? WithdrawVerifyEmailFormTitle { get; set; }
- public string? WithdrawVerifyEmailFormContent { get; set; }
- public string? EmailVerifyFormTitle { get; set; }
- public string? EmailVerifyFormContent { get; set; }
- public string? ChangedEmailFormTitle { get; set; }
- public string? ChangedEmailFormContent { get; set; }
- }
- // ==================================================
- // 외부 API 설정 (External)
- // ==================================================
- public sealed class ExternalApiConfig
- {
- /** YouTube **/
- public string? YouTubeApiKeyEnc { get; set; }
- public string? YouTubeApiName { get; set; }
- /** 구글 **/
- public string? GoogleClientId { get; set; }
- public string? GoogleClientSecretEnc { get; set; }
- public string? GoogleAppId { get; set; }
- /** 다날 페이 **/
- /// <summary>Danal 결제 환경 (test / live)</summary>
- public string? DanalPayMode { get; set; }
- /// <summary>Danal Test CPID</summary>
- public string? DanalTestCpid { get; set; }
- /// <summary>Danal Test Client Key (암호화 저장 권장)</summary>
- public string? DanalTestClientKeyEnc { get; set; }
- /// <summary>Danal Test Secret Key (암호화 저장 권장)</summary>
- public string? DanalTestSecretKeyEnc { get; set; }
- /// <summary>Danal Live CPID</summary>
- public string? DanalLiveCpid { get; set; }
- /// <summary>Danal Live Client Key (암호화 저장 권장)</summary>
- public string? DanalLiveClientKeyEnc { get; set; }
- /// <summary>Danal Live Secret Key (암호화 저장 권장)</summary>
- public string? DanalLiveSecretKeyEnc { get; set; }
- }
- // ==================================================
- // 결제 설정 (Payment)
- // ==================================================
- public sealed class PaymentConfig
- {
- /** 다날 페이 수수료 (% 우선 적용 후 원 가산) **/
- /// <summary>신용카드 수수료(%)</summary>
- public decimal? DanalCardFeeRate { get; set; }
- /// <summary>신용카드 수수료(원)</summary>
- public decimal? DanalCardFeeAmount { get; set; }
- /// <summary>카카오페이 수수료(%)</summary>
- public decimal? DanalKakaoPayFeeRate { get; set; }
- /// <summary>카카오페이 수수료(원)</summary>
- public decimal? DanalKakaoPayFeeAmount { get; set; }
- /// <summary>네이버페이 수수료(%)</summary>
- public decimal? DanalNaverPayFeeRate { get; set; }
- /// <summary>네이버페이 수수료(원)</summary>
- public decimal? DanalNaverPayFeeAmount { get; set; }
- /// <summary>계좌이체 수수료(%)</summary>
- public decimal? DanalTransferFeeRate { get; set; }
- /// <summary>계좌이체 수수료(원)</summary>
- public decimal? DanalTransferFeeAmount { get; set; }
- /// <summary>휴대폰 수수료(%)</summary>
- public decimal? DanalMobileFeeRate { get; set; }
- /// <summary>휴대폰 수수료(원)</summary>
- public decimal? DanalMobileFeeAmount { get; set; }
- /// <summary>가상계좌 수수료(%)</summary>
- public decimal? DanalVbankFeeRate { get; set; }
- /// <summary>가상계좌 수수료(원)</summary>
- public decimal? DanalVbankFeeAmount { get; set; }
- /** 결제수단 사용 여부 (기본 false — 관리자가 명시적으로 활성화) **/
- public bool IsCardEnabled { get; set; } = false;
- public bool IsKakaoPayEnabled { get; set; } = false;
- public bool IsNaverPayEnabled { get; set; } = false;
- public bool IsTransferEnabled { get; set; } = false;
- public bool IsMobileEnabled { get; set; } = false;
- public bool IsVirtualAccountEnabled { get; set; } = false;
- }
- // ==================================================
- // 코인/시세 설정 (Crypto)
- // ==================================================
- public sealed class CryptoConfig
- {
- public int TickerRefreshSeconds { get; set; } = 5;
- public decimal SurgeThreshold { get; set; } = 5.0m;
- public decimal PlungeThreshold { get; set; } = -5.0m;
- public int MainPageCoinCount { get; set; } = 10;
- }
- // ==================================================
- // 채팅 경험치/리더보드 설정 (ChatExp)
- // 관리자: /Channel/Exp 페이지에서 편집
- // ==================================================
- public sealed class ChatExpConfig
- {
- /// <summary>채팅 1건당 지급 XP</summary>
- public int ChatXpPerMessage { get; set; } = 1;
- /// <summary>후원 N POINT당 1 XP (기본 1000 = 1,000원당 1XP)</summary>
- public int DonationXpPerAmount { get; set; } = 1000;
- /// <summary>방송 세션당 채팅 XP 상한 (후원 XP는 무제한)</summary>
- public int ChatXpSessionLimit { get; set; } = 50;
- /// <summary>XP 적립 최소 글자수</summary>
- public int MinContentLength { get; set; } = 2;
- /// <summary>채팅 쿨다운(초) — 기존 RateLimit 재정의</summary>
- public int RateLimitSec { get; set; } = 2;
- /// <summary>리더보드 표시 인원 (Top N)</summary>
- public int LeaderboardSize { get; set; } = 50;
- /// <summary>크라운 뱃지 부여 Top N</summary>
- public int CrownTopN { get; set; } = 3;
- /// <summary>watch 페이지에서 리더보드 기능 노출</summary>
- public bool UxShowLeaderboard { get; set; } = true;
- /// <summary>watch 페이지 채팅창 상단에 "내 XP" 뱃지 노출</summary>
- public bool UxShowMyXpBadge { get; set; } = true;
- }
- // ==================================================
- // 출석 설정 (Attendance)
- // ==================================================
- public sealed class AttendanceConfig
- {
- /// <summary>출석 기능 활성화</summary>
- public bool IsEnabled { get; set; } = false;
- /// <summary>기본 경험치</summary>
- public int BaseExp { get; set; } = 0;
- /// <summary>기본 포인트</summary>
- public int BasePoint { get; set; } = 0;
- /// <summary>연속 출석 가중치 사용</summary>
- public bool UseStreakBonus { get; set; } = false;
- /// <summary>연속 출석 1일당 추가 경험치</summary>
- public int StreakBonusPerDay { get; set; } = 0;
- /// <summary>연속 출석 1일당 추가 포인트</summary>
- public int StreakBonusPointPerDay { get; set; } = 0;
- /// <summary>가중치 최대 적용 일수</summary>
- public int StreakBonusMaxDays { get; set; } = 0;
- /// <summary>순위 보상 사용</summary>
- public bool UseRankBonus { get; set; } = false;
- /// <summary>순위별 보상 설정 (JSON) [{"rank":1,"exp":100,"point":50},...]</summary>
- public string? RankBonusConfig { get; set; }
- }
- #endregion
|