PostMeta.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. using Microsoft.EntityFrameworkCore;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.ComponentModel;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace bitforum.Models.BBS
  6. {
  7. [Table("PostMeta")]
  8. public class PostMeta
  9. {
  10. [ForeignKey("BoardID")]
  11. public Board Board { get; set; } = null!;
  12. [Key]
  13. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  14. [DisplayName("PK")]
  15. [Comment("PK")]
  16. public int ID { get; set; }
  17. [Required]
  18. [DisplayName("게시판 ID")]
  19. [Comment("게시판 ID")]
  20. public int BoardID { get; set; }
  21. public PostViewMeta List { get; set; } = new PostViewMeta();
  22. public PostWriteMeta Write { get; set; } = new PostWriteMeta();
  23. public PostGeneralMeta General { get; set; } = new PostGeneralMeta();
  24. }
  25. [Owned]
  26. public class PostViewMeta
  27. {
  28. [DisplayName("즐겨찾기 기능")]
  29. [Comment("즐겨찾기 기능")]
  30. public bool AllowBookmark { get; set; } = false;
  31. [DisplayName("공감 기능")]
  32. [Comment("공감 기능")]
  33. public bool AllowLike { get; set; } = false;
  34. [DisplayName("비공감 기능")]
  35. [Comment("비공감 기능")]
  36. public bool AllowDislike { get; set; } = false;
  37. [DisplayName("본문 인쇄 기능")]
  38. [Comment("본문 인쇄 기능")]
  39. public bool AllowPrint { get; set; } = false;
  40. [DisplayName("SNS 보내기 기능")]
  41. [Comment("SNS 보내기 기능")]
  42. public bool AllowSnsShare { get; set; } = false;
  43. [DisplayName("이전글, 다음글 버튼")]
  44. [Comment("이전글, 다음글 버튼")]
  45. public bool AllowPrevNextBotton { get; set; } = false;
  46. [DisplayName("신고 기능")]
  47. [Comment("신고 기능")]
  48. public bool AllowBlame { get; set; } = false;
  49. [DisplayName("신고 시 숨김")]
  50. [Comment("신고 시 숨김")]
  51. public ushort BlameHideCount { get; set; } = 0;
  52. [DisplayName("전체공지 제외 여부")]
  53. [Comment("전체공지 제외 여부")]
  54. public bool AllowContentLinkTargetBlank { get; set; } = false;
  55. [DisplayName("주소 복사 버튼")]
  56. [Comment("주소 복사 버튼")]
  57. public bool AllowPostUrlCopy { get; set; } = false;
  58. [DisplayName("글 주소 QR 코드")]
  59. [Comment("글 주소 QR 코드")]
  60. public bool AllowPostUrlQrCode { get; set; } = false;
  61. [DisplayName("회원 사진 공개")]
  62. [Comment("회원 사진 공개")]
  63. public bool ShowMemberPhoto { get; set; } = false;
  64. [DisplayName("회원 아이콘 공개")]
  65. [Comment("회원 아이콘 공개")]
  66. public bool ShowMemberIcon { get; set; } = false;
  67. [DisplayName("회원 가입일 공개")]
  68. [Comment("회원 가입일 공개")]
  69. public bool ShowMemberRegDate { get; set; } = false;
  70. }
  71. [Owned]
  72. public class PostWriteMeta
  73. {
  74. [DisplayName("작성란 상단 내용")]
  75. [Comment("작성란 상단 내용")]
  76. [StringLength(4000)]
  77. public string? HeaderContent { get; set; } = null;
  78. [DisplayName("작성란 하단 내용")]
  79. [Comment("작성란 하단 내용")]
  80. [StringLength(4000)]
  81. public string? FooterContent { get; set; } = null;
  82. [DisplayName("기본 제목")]
  83. [Comment("기본 제목")]
  84. [StringLength(255)]
  85. public string? DefaultSubject { get; set; } = null;
  86. [DisplayName("기본 내용")]
  87. [Comment("기본 내용")]
  88. [StringLength(4000)]
  89. public string? DefaultContent { get; set; } = null;
  90. [DisplayName("웹 에디터 사용")]
  91. [Comment("웹 에디터 사용")]
  92. public bool AllowEditor { get; set; } = false;
  93. [DisplayName("외부 이미지 수집")]
  94. [Comment("외부 이미지 수집")]
  95. public bool AllowSaveExternalImage { get; set; } = false;
  96. [DisplayName("비밀글 사용")]
  97. [Comment("비밀글 사용")]
  98. public bool AllowSecret { get; set; } = false;
  99. [DisplayName("Tag 사용")]
  100. [Comment("Tag 사용")]
  101. public bool AllowTag { get; set; } = false;
  102. [DisplayName("파일 사용")]
  103. [Comment("파일 사용")]
  104. public bool EnableUploadFile { get; set; } = false;
  105. [DisplayName("파일 개수 제한")]
  106. [Comment("파일 개수 제한")]
  107. public byte UploadFilesLimit { get; set; } = 0;
  108. [DisplayName("파일 용량 제한")]
  109. [Comment("파일 용량 제한")]
  110. public ushort UploadFileMaxSize { get; set; } = 0;
  111. [DisplayName("파일 허용 확장자")]
  112. [Comment("파일 허용 확장자")]
  113. [StringLength(200)]
  114. public string? UploadFileExtension { get; set; } = null;
  115. }
  116. [Owned]
  117. public class PostGeneralMeta
  118. {
  119. [DisplayName("게시글 삭제 금지 기간")]
  120. [Comment("게시글 삭제 금지 기간")]
  121. public ushort DeleteProtectionDays { get; set; } = 0;
  122. [DisplayName("게시글 수정/삭제 금지 기간")]
  123. [Comment("게시글 수정/삭제 금지 기간")]
  124. public ushort UpdateProtectionDays { get; set; } = 0;
  125. [DisplayName("게시글 보호 기능 (삭제 시)")]
  126. [Comment("게시글 보호 기능 (삭제 시)")]
  127. public bool AllowDeleteProtection { get; set; } = false;
  128. [DisplayName("게시글 보호 기능 (수정 시)")]
  129. [Comment("게시글 보호 기능 (수정 시)")]
  130. public bool AllowUpdateProtection { get; set; } = false;
  131. [DisplayName("다운로드 기록")]
  132. [Comment("다운로드 기록")]
  133. public bool EnableFileDownLog { get; set; } = false;
  134. [DisplayName("게시글 변경 기록")]
  135. [Comment("게시글 변경 기록")]
  136. public bool EnablePostUpdateLog { get; set; } = false;
  137. }
  138. }