forum.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. // ./constants/forum.ts
  2. // 반응 구분
  3. export const Reaction = {
  4. Like: 1, // 좋아요
  5. Dislike: 2 // 싫어요
  6. };
  7. // 신고 유형
  8. export const ReportType = {
  9. None: 0,
  10. Abuse: 1, // 욕설
  11. Obscene: 2, // 음란
  12. Illegal: 3, // 불법
  13. Impersonation: 4, // 신분 사칭
  14. CashTrade: 5, // 현금거래유도
  15. SpamAd: 6, // 스팸/광고
  16. Flood: 7, // 도배
  17. PersonalLeak: 8, // 개인정보노출
  18. Other: 9 // 기타
  19. };
  20. // 신고 상태
  21. export const ReportStatus = {
  22. Received: 0, // 접수
  23. Processing: 1, // 처리 중
  24. Completed: 2 // 조치 완료
  25. };
  26. export type Reaction = typeof Reaction[keyof typeof Reaction];
  27. export type ReportType = typeof ReportType[keyof typeof ReportType];
  28. export type ReportStatus = typeof ReportStatus[keyof typeof ReportStatus];
  29. // 게시판 종류
  30. export const BoardLayout = {
  31. Default: 0, // 일반
  32. Media: 1, // 사진/동영상
  33. QnA: 2 // 질문과 답변 (1:1 게시판)
  34. } as const;
  35. export type BoardLayout = typeof BoardLayout[keyof typeof BoardLayout];
  36. // 게시판 정렬
  37. export const BoardSort = {
  38. CreatedAt: 0, // 날짜순
  39. Views: 1, // 조회순
  40. Comments: 2, // 댓글순
  41. Likes: 3 // 공감순
  42. } as const;
  43. export type BoardSort = typeof BoardSort[keyof typeof BoardSort];
  44. // 게시글 검색 구분 값
  45. export const enum PostSearchType {
  46. Subject = 0, // 제목
  47. Content = 1, // 댓글
  48. Author = 2, // 작성자
  49. Comment = 3 // 댓글
  50. }
  51. // 게시글 설정 값
  52. export const PostConst = {
  53. MaxAllowedSubjectLength: 120, // 최대 제목 길이
  54. MaxAllowedContentLength: 5000, // 최대 본문 길이
  55. MaxAllowedTags: 10, // 최대 태그 입력 제한 수
  56. MaxAllowedImages: 50, // 최대 이미지 입력 제한 수
  57. MaxAllowedImageSize: 51200, // 최대 이미지 용량(KB)
  58. MaxAllowedMedias: 20, // 최대 미디어 입력 제한 수
  59. MaxAllowedFiles: 10, // 최대 파일 입력 제한 수
  60. MaxAllowedFileSize: 204800, // 최대 파일 용량(KB)
  61. } as const;
  62. // 댓글 설정 값들
  63. export const CommentConst = {
  64. // 목록
  65. DefaultPerPage: 10, // 기본 출력 게시글 수
  66. MaxPerPage: 50, // 최대 출력 게시글 수
  67. // 작성 시
  68. MaxAllowedContentLength: 10000, // 최대 댓글 길이
  69. MaxAllowedImages: 10, // 최대 이미지 입력 제한 수
  70. MaxAllowedImageSize: 51200, // 최대 이미지 용량(KB)
  71. AllowedImageExtensions: ["jpg", "jpeg", "gif", "png"], // 허용 이미지 확장자
  72. MaxAllowedMedias: 20, // 최대 미디어 입력 제한 수
  73. MaxAllowedFiles: 5, // 최대 파일 입력 제한 수
  74. MaxAllowedFileSize: 204800, // 최대 파일 용량(KB)
  75. // 정렬 조건
  76. Sort: {
  77. CreatedAt: 0, // 최신순
  78. Score: 1 // 인기순
  79. } as const,
  80. SortLabels: {
  81. 0: "최신순",
  82. 1: "인기순"
  83. } as const,
  84. // 상태
  85. Status: {
  86. Normal: 0, // 정상
  87. Hidden: 1, // 나만보기
  88. DeletedByOwner: 2, // 본인 삭제
  89. RemovedByAdmin: 3, // 운영자 삭제
  90. Pending: 4 // 보류
  91. } as const,
  92. StatusLabels: {
  93. 0: "최신순",
  94. 1: "나만보기",
  95. 2: "본인 삭제",
  96. 3: "운영자 삭제",
  97. 4: "보류"
  98. } as const,
  99. };
  100. export type CommentSort = typeof CommentConst.Sort[keyof typeof CommentConst.Sort];
  101. export type CommentStatus = typeof CommentConst.Status[keyof typeof CommentConst.Status];