BoardMeta.cs 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. using Domain.Entities.Forum.Constants;
  2. using Domain.Entities.Forum.ValueObject;
  3. using Microsoft.EntityFrameworkCore;
  4. using System.ComponentModel.DataAnnotations;
  5. namespace Domain.Entities.Forum.Boards;
  6. public class BoardMeta
  7. {
  8. [Key]
  9. public int ID { get; set; }
  10. public int BoardID { get; set; }
  11. // 목록
  12. public BoardMetaList List { get; set; } = new BoardMetaList();
  13. // 열람
  14. public BoardMetaView View { get; set; } = new BoardMetaView();
  15. // 작성
  16. public BoardMetaWrite Write { get; set; } = new BoardMetaWrite();
  17. // 댓글
  18. public BoardMetaComment Comment { get; set; } = new BoardMetaComment();
  19. // 일반
  20. public BoardMetaGeneral General { get; set; } = new BoardMetaGeneral();
  21. // 권한
  22. public BoardMetaPermission Permission { get; set; } = new BoardMetaPermission();
  23. // 알람
  24. public BoardMetaNotify Notify { get; set; } = new BoardMetaNotify();
  25. // 알람 양식
  26. public BoardMetaNotifyTemplate NotifyTemplate { get; set; } = new BoardMetaNotifyTemplate();
  27. // 경험치
  28. public BoardMetaExp Exp { get; set; } = new BoardMetaExp();
  29. }
  30. /// <summary>
  31. /// 게시판 목록 설정
  32. /// </summary>
  33. [Owned]
  34. public class BoardMetaList
  35. {
  36. public bool ShowHeader { get; set; } = false;
  37. public string? HeaderContent { get; set; }
  38. public bool ShowFooter { get; set; } = false;
  39. public string? FooterContent { get; set; }
  40. public BoardLayout? Layout { get; set; }
  41. public BoardSort? Sort { get; set; }
  42. public byte PerPage { get; set; } = 0;
  43. public bool AlwaysShowWriteButton { get; set; } = false;
  44. public bool ShowFooterListView { get; set; } = false;
  45. public bool IsNewIcon { get; set; } = false;
  46. public bool IsHotIcon { get; set; } = false;
  47. public bool ExceptNotice { get; set; } = false;
  48. public bool ExceptSpeaker { get; set; } = false;
  49. }
  50. /// <summary>
  51. /// 게시판 열람 설정
  52. /// </summary>
  53. [Owned]
  54. public class BoardMetaView
  55. {
  56. public bool AllowBookmark { get; set; } = false;
  57. public bool AllowLike { get; set; } = false;
  58. public bool AllowDislike { get; set; } = false;
  59. public bool AllowPrint { get; set; } = false;
  60. public bool AllowSnsShare { get; set; } = false;
  61. public bool AllowPrevNextBotton { get; set; } = false;
  62. public bool AllowBlame { get; set; } = false;
  63. public ushort BlameHideCount { get; set; } = 0;
  64. public bool AllowContentLinkTargetBlank { get; set; } = false;
  65. public bool AllowPostUrlCopy { get; set; } = false;
  66. public bool AllowPostUrlQrCode { get; set; } = false;
  67. public bool ShowMemberThumb { get; set; } = false;
  68. public bool ShowMemberIcon { get; set; } = false;
  69. public bool ShowMemberRegDate { get; set; } = false;
  70. public bool ShowMemberSummary { get; set; } = false;
  71. }
  72. /// <summary>
  73. /// 게시판 작성 설정
  74. /// </summary>
  75. [Owned]
  76. public class BoardMetaWrite
  77. {
  78. public bool ShowHeader { get; set; } = false;
  79. public string? HeaderContent { get; set; }
  80. public bool ShowFooter { get; set; } = false;
  81. public string? FooterContent { get; set; }
  82. public string? DefaultSubject { get; set; }
  83. public string? DefaultContent { get; set; }
  84. public bool AllowEditor { get; set; } = false;
  85. public bool AllowPrefix { get; set; } = false;
  86. public bool RequiredPrefix { get; set; } = false;
  87. public bool AllowSecret { get; set; } = false;
  88. public bool AllowTag { get; set; } = false;
  89. public byte TagLimit { get; set; } = PostConstant.MaxAllowedTags;
  90. public bool AllowImage { get; set; } = false;
  91. public byte ImageUploadLimit { get; set; } = PostConstant.MaxAllowedImages;
  92. public int ImageUploadMaxSize { get; set; } = PostConstant.MaxAllowedImageSize;
  93. public bool AllowMedia { get; set; } = false;
  94. public byte MediaUploadLimit { get; set; } = PostConstant.MaxAllowedMedias;
  95. public bool AllowFile { get; set; } = false;
  96. public byte FileUploadLimit { get; set; } = PostConstant.MaxAllowedFiles;
  97. public int FileUploadMaxSize { get; set; } = PostConstant.MaxAllowedFileSize;
  98. public string? FileUploadExtension { get; set; }
  99. }
  100. /// <summary>
  101. /// 게시판 일반 설정
  102. /// </summary>
  103. [Owned]
  104. public class BoardMetaGeneral
  105. {
  106. public ushort DeleteProtectionDays { get; set; } = 0;
  107. public ushort UpdateProtectionDays { get; set; } = 0;
  108. public bool AllowDeleteProtection { get; set; } = false;
  109. public bool AllowUpdateProtection { get; set; } = false;
  110. public bool EnableFileDownLog { get; set; } = false;
  111. public bool EnableLinkClickLog { get; set; } = false;
  112. public bool EnablePostUpdateLog { get; set; } = false;
  113. }
  114. /// <summary>
  115. /// 게시판 권한 설정
  116. /// </summary>
  117. [Owned]
  118. public class BoardMetaPermission
  119. {
  120. public short BoardAccess { get; set; } = (short)BoardPermission.Guest;
  121. public short PostView { get; set; } = (short)BoardPermission.Guest;
  122. public short PostWrite { get; set; } = (short)BoardPermission.Guest;
  123. public short CommentView { get; set; } = (short)BoardPermission.Guest;
  124. public short CommentWrite { get; set; } = (short)BoardPermission.Guest;
  125. public short ReplyWrite { get; set; } = (short)BoardPermission.Guest;
  126. public short FileUpload { get; set; } = (short)BoardPermission.Guest;
  127. public short FileDownload { get; set; } = (short)BoardPermission.Guest;
  128. }
  129. /// <summary>
  130. /// 게시판 알림 설정
  131. /// </summary>
  132. [Owned]
  133. public class BoardMetaNotify
  134. {
  135. public byte? PostWriteNotify { get; set; }
  136. public byte? CommentWriteNotify { get; set; }
  137. public byte? ReplyWriteNotify { get; set; }
  138. public BoardNotify PostWriteNotifyEnum => (BoardNotify)(PostWriteNotify ?? 0);
  139. public BoardNotify CommentWriteNotifyEnum => (BoardNotify)(CommentWriteNotify ?? 0);
  140. public BoardNotify ReplyWriteNotifyEnum => (BoardNotify)(ReplyWriteNotify ?? 0);
  141. }
  142. /// <summary>
  143. /// 게시판 경험치 설정
  144. /// </summary>
  145. [Owned]
  146. public class BoardMetaExp
  147. {
  148. public bool EnableExp { get; set; } = false;
  149. public bool ShowExpGuide { get; set; } = false;
  150. /*
  151. * 경험치 지급량 조절
  152. */
  153. public ushort PostWriteExp { get; set; } = 0;
  154. public ushort CommentWriteExp { get; set; } = 0;
  155. public ushort FileUploadExp { get; set; } = 0;
  156. public short FileDownloadExp { get; set; } = 0;
  157. public short OtherPostReadExp { get; set; } = 0;
  158. public ushort OtherPostLikeExp { get; set; } = 0;
  159. public ushort OtherPostDisLikeExp { get; set; } = 0;
  160. public ushort OtherCommentLikeExp { get; set; } = 0;
  161. public ushort OtherCommentDisLikeExp { get; set; } = 0;
  162. public ushort OwnPostReadExp { get; set; } = 0;
  163. public ushort OwnPostLikeExp { get; set; } = 0;
  164. public short OwnPostDisLikeExp { get; set; } = 0;
  165. public ushort OwnCommentLikeExp { get; set; } = 0;
  166. public short OwnCommentDisLikeExp { get; set; } = 0;
  167. /*
  168. * 경험치 회수량 조절 (항상 음수 계산)
  169. */
  170. public ushort PostWriteUndoExp { get; set; } = 0;
  171. public ushort CommentWriteUndoExp { get; set; } = 0;
  172. public ushort FileUploadUndoExp { get; set; } = 0;
  173. public ushort OtherPostReadUndoExp { get; set; } = 0;
  174. public ushort OtherPostLikeUndoExp { get; set; } = 0;
  175. public ushort OtherPostDisLikeUndoExp { get; set; } = 0;
  176. public ushort OtherCommentLikeUndoExp { get; set; } = 0;
  177. public ushort OtherCommentDisLikeUndoExp { get; set; } = 0;
  178. public ushort OwnPostReadUndoExp { get; set; } = 0;
  179. public ushort OwnPostLikeUndoExp { get; set; } = 0;
  180. public ushort OwnPostDisLikeUndoExp { get; set; } = 0;
  181. public ushort OwnCommentLikeUndoExp { get; set; } = 0;
  182. public ushort OwnCommentDisLikeUndoExp { get; set; } = 0;
  183. /*
  184. * 경험치 지급 기한
  185. */
  186. public ushort PostWriteExpWithinDays { get; set; } = 0;
  187. public ushort CommentWriteExpWithinDays { get; set; } = 0;
  188. public ushort FileUploadExpWithinDays { get; set; } = 0;
  189. public ushort OtherPostReadExpWithinDays { get; set; } = 0;
  190. public ushort OtherPostLikeExpWithinDays { get; set; } = 0;
  191. public ushort OtherPostDisLikeExpWithinDays { get; set; } = 0;
  192. public ushort OtherCommentLikeExpWithinDays { get; set; } = 0;
  193. public ushort OtherCommentDisLikeExpWithinDays { get; set; } = 0;
  194. public ushort OwnPostReadExpWithinDays { get; set; } = 0;
  195. public ushort OwnPostLikeExpWithinDays { get; set; } = 0;
  196. public ushort OwnPostDisLikeExpWithinDays { get; set; } = 0;
  197. public ushort OwnCommentLikeExpWithinDays { get; set; } = 0;
  198. public ushort OwnCommentDisLikeExpWithinDays { get; set; } = 0;
  199. }
  200. /// <summary>
  201. /// 게시판 알림 양식
  202. /// </summary>
  203. [Owned]
  204. public class BoardMetaNotifyTemplate
  205. {
  206. public string? PostWriteEmailNotifySubject { get; set; }
  207. public string? PostWriteEmailNotifyContent { get; set; }
  208. public string? CommentWriteEmailNotifySubject { get; set; }
  209. public string? CommentWriteEmailNotifyContent { get; set; }
  210. public string? ReplyWriteEmailNotifySubject { get; set; }
  211. public string? ReplyWriteEmailNotifyContent { get; set; }
  212. }
  213. /// <summary>
  214. /// 게시판 댓글 설정
  215. /// </summary>
  216. [Owned]
  217. public class BoardMetaComment
  218. {
  219. public bool EnableComment { get; set; } = false;
  220. public ushort PerPage { get; set; } = 0;
  221. public bool AllowLike { get; set; } = false;
  222. public bool AllowDisLike { get; set; } = false;
  223. public bool ShowMemberThumb { get; set; } = false;
  224. public bool ShowMemberIcon { get; set; } = false;
  225. public string? ContentPlaceholder { get; set; }
  226. public ushort MinContentLength { get; set; } = 0;
  227. public ushort MaxContentLength { get; set; } = 0;
  228. public bool EnableEditor { get; set; } = false;
  229. public bool AllowSecret { get; set; } = false;
  230. public ushort BlameHideCount { get; set; } = 0;
  231. public ushort DeleteProtectionDays { get; set; } = 0;
  232. public ushort UpdateProtectionDays { get; set; } = 0;
  233. public bool AllowDeleteProtection { get; set; } = false;
  234. public bool AllowUpdateProtection { get; set; } = false;
  235. public bool EnableCommentUpdateLog { get; set; } = false;
  236. }