BoardMeta.cs 11 KB

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