Config.cs 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302
  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; } = null!;
  15. public string? Value { get; set; }
  16. public string? Description { get; set; }
  17. public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
  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_name")]
  33. public string? FromName { 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 int? SmtpPort { get; set; } = null;
  40. [Display(Name = "SMTP Enable SSL")]
  41. [BindProperty(Name = "smtp_enable_ssl")]
  42. public char SmtpEnableSSL { get; set; } = 'N';
  43. [Display(Name = "SMTP Username")]
  44. [BindProperty(Name = "smtp_username")]
  45. public string? SmtpUsername { get; set; } = null;
  46. [Display(Name = "SMTP Password")]
  47. [BindProperty(Name = "smtp_password")]
  48. public string? SmtpPassword { get; set; } = null;
  49. [Display(Name = "관리자단 접근 가능 IP")]
  50. [BindProperty(Name = "admin_white_ip_list")]
  51. public string? AdminWhiteIPList { get; set; } = null;
  52. [Display(Name = "사용자단 접근 가능 IP")]
  53. [BindProperty(Name = "front_white_ip_list")]
  54. public string? FrontWhiteIPList { get; set; } = null;
  55. [Display(Name = "차단 시 안내문 제목")]
  56. [BindProperty(Name = "block_alert_title")]
  57. public string? BlockAlertTitle { get; set; } = null;
  58. [Display(Name = "차단 시 안내문 내용")]
  59. [BindProperty(Name = "block_alert_content")]
  60. public string? BlockAlertContent { get; set; } = null;
  61. [Display(Name = "점검 여부")]
  62. [BindProperty(Name = "is_maintenance")]
  63. [RegularExpression("^[01]$", ErrorMessage = "점검 여부는 0 또는 1이어야 합니다.")]
  64. public char IsMaintenance { get; set; } = '0';
  65. [Display(Name = "점검 내용")]
  66. [BindProperty(Name = "maintenance_content")]
  67. public string? MaintenanceContent { get; set; } = null;
  68. }
  69. // 메타 태그
  70. public class MetaForm
  71. {
  72. [Display(Name = "Meta Keywords")]
  73. [BindProperty(Name = "meta_keywords")]
  74. public string? MetaKeyword { get; set; } = null;
  75. [Display(Name = "Meta Description")]
  76. [BindProperty(Name = "meta_description")]
  77. public string? MetaDescription { get; set; } = null;
  78. [Display(Name = "Meta Author")]
  79. [BindProperty(Name = "meta_author")]
  80. public string? MetaAuthor { get; set; } = null;
  81. [Display(Name = "Meta Viewport")]
  82. [BindProperty(Name = "meta_viewport")]
  83. public string? MetaViewport { get; set; } = null;
  84. [Display(Name = "Meta Application Name")]
  85. [BindProperty(Name = "meta_application_name")]
  86. public string? MetaApplicationName { get; set; } = null;
  87. [Display(Name = "Meta Generator")]
  88. [BindProperty(Name = "meta_generator")]
  89. public string? MetaGenerator { get; set; } = null;
  90. [Display(Name = "Meta Robots")]
  91. [BindProperty(Name = "meta_robots")]
  92. public string? MetaRobots { get; set; } = null;
  93. [Display(Name = "Meta Adds")]
  94. [BindProperty(Name = "meta_adds")]
  95. public string? MetaAdds { get; set; } = null;
  96. }
  97. // 회사 정보
  98. public class CompanyForm
  99. {
  100. [Display(Name = "상호 명")]
  101. [BindProperty(Name = "company_name")]
  102. public string? CompanyName { get; set; } = null;
  103. [Display(Name = "사업자 등록 번호")]
  104. [BindProperty(Name = "company_reg_no")]
  105. public string? CompanyRegNo { get; set; } = null;
  106. [Display(Name = "대표자 명")]
  107. [BindProperty(Name = "company_owner")]
  108. public string? CompanyOwner { get; set; } = null;
  109. [Display(Name = "대표 전화번호")]
  110. [BindProperty(Name = "company_tel")]
  111. public string? CompanyTel { get; set; } = null;
  112. [Display(Name = "FAX 번호")]
  113. [BindProperty(Name = "company_fax")]
  114. public string? CompanyFax { get; set; } = null;
  115. [Display(Name = "통신판매업 신고번호")]
  116. [BindProperty(Name = "company_retail_sale_no")]
  117. public string? CompanyRetailSaleNo { get; set; } = null;
  118. [Display(Name = "부가통신 사업자번호")]
  119. [BindProperty(Name = "company_added_sale_no")]
  120. public string? CompanyAddedSaleNo { get; set; } = null;
  121. [Display(Name = "사업장 주소")]
  122. [BindProperty(Name = "company_zip_code")]
  123. public string? CompanyZipCode { get; set; } = null;
  124. [Display(Name = "호스팅 서비스")]
  125. [BindProperty(Name = "company_hosting")]
  126. public string? CompanyHosting { get; set; } = null;
  127. [Display(Name = "정보관리책임자")]
  128. [BindProperty(Name = "company_admin_name")]
  129. public string? CompanyAdminName { get; set; } = null;
  130. [Display(Name = "정보관리책임자 E-mail")]
  131. [BindProperty(Name = "company_admin_email")]
  132. public string? CompanyAdminEmail { get; set; } = null;
  133. [Display(Name = "사이트 주소")]
  134. [BindProperty(Name = "company_site_url")]
  135. public string? CompanySiteURL { get; set; } = null;
  136. [Display(Name = "입금 계좌")]
  137. [BindProperty(Name = "company_bank_code")]
  138. public int? CompanyBankCode { get; set; }
  139. [Display(Name = "예금주")]
  140. [BindProperty(Name = "company_bank_owner")]
  141. public string? CompanyBankOwner { get; set; } = null;
  142. [Display(Name = "계좌번호")]
  143. [BindProperty(Name = "company_bank_number")]
  144. public string? CompanyBankNumber { get; set; } = null;
  145. }
  146. // 회원가입 설정
  147. public class RegisterForm
  148. {
  149. [Display(Name = "회원가입 차단")]
  150. [BindProperty(Name = "is_register_block")]
  151. public char IsRegisterBlock { get; set; } = 'N';
  152. [Display(Name = "회원가입 시 이메일 인증")]
  153. [BindProperty(Name = "is_register_email_auth")]
  154. public char IsRegisterEmailAuth { get; set; } = 'N';
  155. [Display(Name = "비밀번호 최소 길이")]
  156. [BindProperty(Name = "password_min_length")]
  157. public int? PasswordMinLength { get; set; } = null;
  158. [Display(Name = "비밀번호 최소 대문자 수")]
  159. [BindProperty(Name = "password_uppercase_length")]
  160. public int? PasswordUppercaseLength { get; set; } = null;
  161. [Display(Name = "비밀번호 최소 숫자 수")]
  162. [BindProperty(Name = "password_numbers_length")]
  163. public int? PasswordNumbersLength { get; set; } = null;
  164. [Display(Name = "비밀번호 최소 특수문자 수")]
  165. [BindProperty(Name = "password_specialchars_length")]
  166. public int? PasswordSpecialcharsLength { get; set; } = null;
  167. [Display(Name = "금지 이메일")]
  168. [BindProperty(Name = "denied_email_list")]
  169. public string? DeniedEmailList { get; set; } = null;
  170. [Display(Name = "금지 별명")]
  171. [BindProperty(Name = "denied_nickname_list")]
  172. public string? DeniedNicknameList { get; set; } = null;
  173. [Display(Name = "별명 갱신 주기")]
  174. [BindProperty(Name = "change_nickname_day")]
  175. public int? ChangeNicknameDay { get; set; } = null;
  176. [Display(Name = "이메일 갱신 주기")]
  177. [BindProperty(Name = "change_email_day")]
  178. public int? ChangeEmailDay { get; set; } = null;
  179. [Display(Name = "비밀번호 갱신 주기")]
  180. [BindProperty(Name = "change_password_day")]
  181. public int? ChangePasswordDay { get; set; } = null;
  182. [Display(Name = "로그인 시도 제한 횟수")]
  183. [BindProperty(Name = "max_login_try_count")]
  184. public int? MaxLoginTryCount { get; set; } = null;
  185. [Display(Name = "로그인 시도 제한 시간")]
  186. [BindProperty(Name = "max_login_try_limit_second")]
  187. public int? MaxLoginTryLimitSecond { get; set; } = null;
  188. }
  189. // 알림 발송 양식 - 이메일
  190. public class EmailTemplate
  191. {
  192. [Display(Name = "회원가입 시 - 제목")]
  193. [BindProperty(Name = "register_email_form_title")]
  194. public string? RegisterEmailFormTitle { get; set; } = null;
  195. [Display(Name = "회원가입 시 - 내용")]
  196. [BindProperty(Name = "register_email_form_content")]
  197. public string? RegisterEmailFormContent { get; set; } = null;
  198. [Display(Name = "회원가입 완료- 제목")]
  199. [BindProperty(Name = "registration_email_form_title")]
  200. public string? RegistrationEmailFormTitle { get; set; } = null;
  201. [Display(Name = "회원가입 완료 - 내용")]
  202. [BindProperty(Name = "registration_email_form_content")]
  203. public string? RegistrationEmailFormContent { get; set; } = null;
  204. [Display(Name = "비밀번호 재설정 - 제목")]
  205. [BindProperty(Name = "forgot_password_email_form_title")]
  206. public string? ResetPasswordEmailFormTitle { get; set; } = null;
  207. [Display(Name = "비밀번호 재설정 - 내용")]
  208. [BindProperty(Name = "forgot_password_email_form_content")]
  209. public string? ResetPasswordEmailFormContent { get; set; } = null;
  210. [Display(Name = "비밀번호 변경 완료 - 제목")]
  211. [BindProperty(Name = "changed_password_email_form_title")]
  212. public string? ChangedPasswordEmailFormTitle { get; set; } = null;
  213. [Display(Name = "비밀번호 변경 완료 - 내용")]
  214. [BindProperty(Name = "changed_password_email_form_content")]
  215. public string? ChangedPasswordEmailFormContent { get; set; } = null;
  216. [Display(Name = "회원탈퇴 시- 제목")]
  217. [BindProperty(Name = "withdraw_email_form_title")]
  218. public string? WithdrawEmailFormTitle { get; set; } = null;
  219. [Display(Name = "회원탈퇴 시 - 내용")]
  220. [BindProperty(Name = "withdraw_email_form_content")]
  221. public string? WithdrawEmailFormContent { get; set; } = null;
  222. [Display(Name = "이메일 변경 시 - 제목")]
  223. [BindProperty(Name = "email_verify_form_title")]
  224. public string? EmailVerifyFormTitle { get; set; } = null;
  225. [Display(Name = "이메일 변경 시 - 내용")]
  226. [BindProperty(Name = "email_verify_form_content")]
  227. public string? EmailVerifyFormContent { get; set; } = null;
  228. [Display(Name = "이메일 변경 완료 - 제목")]
  229. [BindProperty(Name = "changed_email_form_title")]
  230. public string? ChangedEmailFormTitle { get; set; } = null;
  231. [Display(Name = "이메일 변경 완료 - 내용")]
  232. [BindProperty(Name = "changed_email_form_content")]
  233. public string? ChangedEmailFormContent { get; set; } = null;
  234. }
  235. }