forum.ts 3.7 KB

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