forum.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. export const ReportTypeLabels: Record<ReportType, string> = {
  30. [ReportType.None]: '신고 유형을 선택하세요.',
  31. [ReportType.Abuse]: '욕설',
  32. [ReportType.Obscene]: '음란',
  33. [ReportType.Illegal]: '불법',
  34. [ReportType.Impersonation]: '신분 사칭',
  35. [ReportType.CashTrade]: '현금거래 유도',
  36. [ReportType.SpamAd]: '스팸/광고',
  37. [ReportType.Flood]: '도배',
  38. [ReportType.PersonalLeak]: '개인정보 노출',
  39. [ReportType.Other]: '기타'
  40. };
  41. // 게시판 종류
  42. export const BoardLayout = {
  43. Default: 0, // 일반
  44. Media: 1, // 사진/동영상
  45. QnA: 2 // 질문과 답변 (1:1 게시판)
  46. } as const;
  47. export type BoardLayout = typeof BoardLayout[keyof typeof BoardLayout];
  48. // 게시판 정렬
  49. export const BoardSort = {
  50. CreatedAt: 0, // 날짜순
  51. Views: 1, // 조회순
  52. Comments: 2, // 댓글순
  53. Likes: 3 // 공감순
  54. } as const;
  55. export type BoardSort = typeof BoardSort[keyof typeof BoardSort];
  56. // 게시글 검색 구분 값
  57. export const enum PostSearchType {
  58. Subject = 0, // 제목
  59. Content = 1, // 댓글
  60. Author = 2, // 작성자
  61. Comment = 3 // 댓글
  62. }
  63. // 게시글 설정 값
  64. export const PostConst = {
  65. MaxAllowedSubjectLength: 120, // 최대 제목 길이
  66. MaxAllowedContentLength: 5000, // 최대 본문 길이
  67. MaxAllowedTags: 10, // 최대 태그 입력 제한 수
  68. MaxAllowedImages: 50, // 최대 이미지 입력 제한 수
  69. MaxAllowedImageSize: 51200, // 최대 이미지 용량(KB)
  70. MaxAllowedMedias: 20, // 최대 미디어 입력 제한 수
  71. MaxAllowedFiles: 10, // 최대 파일 입력 제한 수
  72. MaxAllowedFileSize: 204800, // 최대 파일 용량(KB)
  73. } as const;
  74. // 댓글 설정 값들
  75. export const CommentConst = {
  76. // 목록
  77. DefaultPerPage: 10, // 기본 출력 게시글 수
  78. MaxPerPage: 50, // 최대 출력 게시글 수
  79. // 작성 시
  80. MaxAllowedContentLength: 10000, // 최대 댓글 길이
  81. MaxAllowedImages: 10, // 최대 이미지 입력 제한 수
  82. MaxAllowedImageSize: 51200, // 최대 이미지 용량(KB)
  83. AllowedImageExtensions: ["jpg", "jpeg", "gif", "png"], // 허용 이미지 확장자
  84. MaxAllowedMedias: 20, // 최대 미디어 입력 제한 수
  85. MaxAllowedFiles: 5, // 최대 파일 입력 제한 수
  86. MaxAllowedFileSize: 204800, // 최대 파일 용량(KB)
  87. // 정렬 조건
  88. Sort: {
  89. CreatedAt: 0, // 최신순
  90. Score: 1 // 인기순
  91. } as const,
  92. SortLabels: {
  93. 0: "최신순",
  94. 1: "인기순"
  95. } as const,
  96. // 상태
  97. Status: {
  98. Normal: 0, // 정상
  99. Hidden: 1, // 나만보기
  100. DeletedByOwner: 2, // 본인 삭제
  101. RemovedByAdmin: 3, // 운영자 삭제
  102. Pending: 4 // 보류
  103. } as const,
  104. StatusLabels: {
  105. 0: "최신순",
  106. 1: "나만보기",
  107. 2: "본인 삭제",
  108. 3: "운영자 삭제",
  109. 4: "보류"
  110. } as const,
  111. };
  112. export type CommentSort = typeof CommentConst.Sort[keyof typeof CommentConst.Sort];
  113. export type CommentStatus = typeof CommentConst.Status[keyof typeof CommentConst.Status];