게시판
게시글 조회는 공개 API로 사용할 수 있고, 글 작성과 댓글 작성은 사용자 토큰이 필요합니다. 게시판별 쓰기/댓글 권한은 게시판 상세와 게시글 상세 응답으로 확인합니다.
공개 조회
섹션 제목: “공개 조회”| 메서드 | 경로 | 설명 | 사용자 토큰 |
|---|---|---|---|
| GET | /boards | 게시판 목록 조회 | 필요 없음 |
| GET | /boards/{boardId} | 게시판 상세 조회 | 필요 없음 |
| GET | /posts | 게시글 목록 조회 | 필요 없음 |
| GET | /posts/{postId} | 게시글 상세 조회 | 필요 없음 |
| GET | /posts/{postId}/comments | 댓글 목록 조회 | 게시글 권한에 따라 다름 |
| 메서드 | 경로 | 설명 | 사용자 토큰 |
|---|---|---|---|
| POST | /posts | 게시글 작성 | 필수 |
| POST | /comments | 댓글 작성 | 필수 |
구현 규칙
섹션 제목: “구현 규칙”- 게시판 이름은 보통
title필드로 내려옵니다. - 게시글 목록은
posts가 아니라board_contents.data로 내려올 수 있습니다. - 게시글 상세 응답에는
comment_mode,can_read_comment,can_write_comment가 함께 내려옵니다. - 댓글은
GET /posts/{postId}/comments로 별도 조회하세요. - 공지사항처럼
write: "0"또는posting_scope: "admin_only"인 게시판은 외부 storefront에서 글쓰기 UI를 노출하지 마세요. - 댓글이 비활성화된 게시판은
comment_mode: "disabled"입니다.
게시글 상세에서 확인할 권한 값
섹션 제목: “게시글 상세에서 확인할 권한 값”{ "board_content": { "ID": 1184, "board_id": 13522, "title": "문의 제목", "content": "본문", "writer_name": "런모아" }, "comment_mode": "flat", "can_read_comment": false, "can_write_comment": false}can_read_comment: false면 댓글 목록 UI 대신 로그인 또는 권한 안내를 보여주세요.can_write_comment: false면 댓글 입력 폼을 숨기세요.comment_mode: "disabled"면 댓글 섹션 자체를 비활성화하세요.
게시글 목록 예시
섹션 제목: “게시글 목록 예시”const posts = await fetch(`${API_BASE}/posts?board_id=1&page=1`, { headers: { 'X-Runmoa-Site-Key': STOREFRONT_KEY, Accept: 'application/json', },}).then((response) => response.json());댓글 목록 조회 예시
섹션 제목: “댓글 목록 조회 예시”const comments = await fetch(`${API_BASE}/posts/123/comments`, { headers: { 'X-Runmoa-Site-Key': STOREFRONT_KEY, Accept: 'application/json', }, credentials: 'include',}).then((response) => response.json());댓글 작성 예시
섹션 제목: “댓글 작성 예시”await fetch(`${API_BASE}/comments`, { method: 'POST', headers: { 'X-Runmoa-Site-Key': STOREFRONT_KEY, Authorization: `Bearer ${token}`, 'Content-Type': 'application/json', Accept: 'application/json', }, body: JSON.stringify({ content_id: 123, content: '문의드립니다.', }),});