Config.cs 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. using Microsoft.AspNetCore.Mvc;
  2. using Microsoft.EntityFrameworkCore;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace bitforum.Models
  6. {
  7. [Table("Config")]
  8. [Index(nameof(Key), IsUnique = true)]
  9. public class Config
  10. {
  11. [Key]
  12. public int ID { get; set; }
  13. [Required]
  14. public string Key { get; set; }
  15. public string? Value { get; set; }
  16. public string? Description { get; set; }
  17. public DateTime CreatedAt { get; set; } = DateTime.Now;
  18. }
  19. // 기본 정보
  20. public class BasicForm
  21. {
  22. [Display(Name = "사이트 이름")]
  23. [BindProperty(Name = "site_name")]
  24. public string? SiteName { get; set; } = null;
  25. [Display(Name = "최고 관리자")]
  26. [BindProperty(Name = "root_id")]
  27. public string? RootID { get; set; } = null;
  28. [Display(Name = "송수신 이메일")]
  29. [BindProperty(Name = "from_email")]
  30. public string? FromEmail { get; set; } = null;
  31. [Display(Name = "송수신자 이름")]
  32. [BindProperty(Name = "from_email_name")]
  33. public string? FromEmailName { get; set; } = null;
  34. [Display(Name = "SMTP Server")]
  35. [BindProperty(Name = "smtp_server")]
  36. public string? SmtpServer { get; set; } = null;
  37. [Display(Name = "SMTP Port")]
  38. [BindProperty(Name = "smtp_port")]
  39. public string? SmtpPort { get; set; } = null;
  40. [Display(Name = "SMTP From Email")]
  41. [BindProperty(Name = "smtp_from_email")]
  42. public string? SmtpFromEmail { get; set; } = null;
  43. [Display(Name = "SMTP Email Password")]
  44. [BindProperty(Name = "smtp_email_password")]
  45. public string? SmtpEmailPassword { get; set; } = null;
  46. [Display(Name = "관리자단 접근 가능 IP")]
  47. [BindProperty(Name = "admin_white_ip_list")]
  48. public string? AdminWhiteIPList { get; set; } = null;
  49. [Display(Name = "사용자단 접근 가능 IP")]
  50. [BindProperty(Name = "front_white_ip_list")]
  51. public string? FrontWhiteIPList { get; set; } = null;
  52. [Display(Name = "차단 시 안내문 제목")]
  53. [BindProperty(Name = "block_alert_title")]
  54. public string? BlockAlertTitle { get; set; } = null;
  55. [Display(Name = "차단 시 안내문 내용")]
  56. [BindProperty(Name = "block_alert_content")]
  57. public string? BlockAlertContent { get; set; } = null;
  58. [Display(Name = "점검 여부")]
  59. [BindProperty(Name = "is_maintenance")]
  60. [RegularExpression("^[01]$", ErrorMessage = "점검 여부는 0 또는 1이어야 합니다.")]
  61. public char IsMaintenance { get; set; } = '0';
  62. [Display(Name = "점검 내용")]
  63. [BindProperty(Name = "maintenance_content")]
  64. public string? MaintenanceContent { get; set; } = null;
  65. }
  66. // 메타 태그
  67. public class MetaForm
  68. {
  69. [Display(Name = "Meta Keywords")]
  70. [BindProperty(Name = "meta_keywords")]
  71. public string? MetaKeyword { get; set; } = null;
  72. [Display(Name = "Meta Description")]
  73. [BindProperty(Name = "meta_description")]
  74. public string? MetaDescription { get; set; } = null;
  75. [Display(Name = "Meta Author")]
  76. [BindProperty(Name = "meta_author")]
  77. public string? MetaAuthor { get; set; } = null;
  78. [Display(Name = "Meta Viewport")]
  79. [BindProperty(Name = "meta_viewport")]
  80. public string? MetaViewport { get; set; } = null;
  81. [Display(Name = "Meta Application Name")]
  82. [BindProperty(Name = "meta_application_name")]
  83. public string? MetaApplicationName { get; set; } = null;
  84. [Display(Name = "Meta Generator")]
  85. [BindProperty(Name = "meta_generator")]
  86. public string? MetaGenerator { get; set; } = null;
  87. [Display(Name = "Meta Robots")]
  88. [BindProperty(Name = "meta_robots")]
  89. public string? MetaRobots { get; set; } = null;
  90. [Display(Name = "Meta Adds")]
  91. [BindProperty(Name = "meta_adds")]
  92. public string? MetaAdds { get; set; } = null;
  93. }
  94. // 회사 정보
  95. public class CompanyForm
  96. {
  97. [Display(Name = "상호 명")]
  98. [BindProperty(Name = "company_name")]
  99. public string? CompanyName { get; set; } = null;
  100. [Display(Name = "사업자 등록 번호")]
  101. [BindProperty(Name = "company_reg_no")]
  102. public string? CompanyRegNo { get; set; } = null;
  103. [Display(Name = "대표자 명")]
  104. [BindProperty(Name = "company_owner")]
  105. public string? CompanyOwner { get; set; } = null;
  106. [Display(Name = "대표 전화번호")]
  107. [BindProperty(Name = "company_tel")]
  108. public string? CompanyTel { get; set; } = null;
  109. [Display(Name = "FAX 번호")]
  110. [BindProperty(Name = "company_fax")]
  111. public string? CompanyFax { get; set; } = null;
  112. [Display(Name = "통신판매업 신고번호")]
  113. [BindProperty(Name = "company_retail_sale_no")]
  114. public string? CompanyRetailSaleNo { get; set; } = null;
  115. [Display(Name = "부가통신 사업자번호")]
  116. [BindProperty(Name = "company_added_sale_no")]
  117. public string? CompanyAddedSaleNo { get; set; } = null;
  118. [Display(Name = "사업장 주소")]
  119. [BindProperty(Name = "company_zip_code")]
  120. public string? CompanyZipCode { get; set; } = null;
  121. [Display(Name = "호스팅 서비스")]
  122. [BindProperty(Name = "company_hosting")]
  123. public string? CompanyHosting { get; set; } = null;
  124. [Display(Name = "정보관리책임자")]
  125. [BindProperty(Name = "company_admin_name")]
  126. public string? CompanyAdminName { get; set; } = null;
  127. [Display(Name = "정보관리책임자 E-mail")]
  128. [BindProperty(Name = "company_admin_email")]
  129. public string? CompanyAdminEmail { get; set; } = null;
  130. [Display(Name = "사이트 주소")]
  131. [BindProperty(Name = "company_site_url")]
  132. public string? CompanySiteURL { get; set; } = null;
  133. [Display(Name = "입금 계좌")]
  134. [BindProperty(Name = "company_bank_code")]
  135. public int? CompanyBankCode { get; set; }
  136. [Display(Name = "예금주")]
  137. [BindProperty(Name = "company_bank_owner")]
  138. public string? CompanyBankOwner { get; set; } = null;
  139. [Display(Name = "계좌번호")]
  140. [BindProperty(Name = "company_bank_number")]
  141. public string? CompanyBankNumber { get; set; } = null;
  142. }
  143. // 회원가입 설정
  144. public class RegisterForm
  145. {
  146. [Display(Name = "회원가입 차단")]
  147. [BindProperty(Name = "is_register_block")]
  148. public bool IsRegisterBlock { get; set; } = false;
  149. [Display(Name = "회원가입 시 이메일 인증")]
  150. [BindProperty(Name = "register_able")]
  151. public bool IsRegisterEmailAuth { get; set; } = false;
  152. [Display(Name = "비밀번호 최소 길이")]
  153. [BindProperty(Name = "password_min_length")]
  154. public int? PasswordMinLength { get; set; } = null;
  155. [Display(Name = "비밀번호 최소 대문자 수")]
  156. [BindProperty(Name = "password_uppercase_length")]
  157. public int? PasswordUppercaseLength { get; set; } = null;
  158. [Display(Name = "비밀번호 최소 숫자 수")]
  159. [BindProperty(Name = "password_numbers_length")]
  160. public int? PasswordNumbersLength { get; set; } = null;
  161. [Display(Name = "비밀번호 최소 특수문자 수")]
  162. [BindProperty(Name = "password_specialchars_length")]
  163. public int? PasswordSpecialcharsLength { get; set; } = null;
  164. [Display(Name = "금지 별명")]
  165. [BindProperty(Name = "denied_nickname_list")]
  166. public string? DeniedNicknameList { get; set; } = null;
  167. [Display(Name = "별명 갱신 주기")]
  168. [BindProperty(Name = "change_nickname_day")]
  169. public int? ChangeNicknameDay { get; set; } = null;
  170. [Display(Name = "이메일 갱신 주기")]
  171. [BindProperty(Name = "change_email_day")]
  172. public int? ChangeEmailDay { get; set; } = null;
  173. [Display(Name = "비밀번호 갱신 주기")]
  174. [BindProperty(Name = "change_password_day")]
  175. public int? ChangePasswordDay { get; set; } = null;
  176. [Display(Name = "로그인 시도 제한 횟수")]
  177. [BindProperty(Name = "max_login_try_count")]
  178. public int? MaxLoginTryCount { get; set; } = null;
  179. [Display(Name = "로그인 시도 제한 시간")]
  180. [BindProperty(Name = "max_login_try_limit_second")]
  181. public int? MaxLoginTryLimitSecond { get; set; } = null;
  182. }
  183. }