- 작성자 아바타: post/comment 조회 시 member JOIN(google_picture/profile_image),
목록·상세·댓글 응답에 노출
- 추천/비추천: post_vote/comment_vote 테이블 + 토글 API
(POST /board/posts|comments/{id}/vote), 게시글/댓글 응답에 up/down/myVote
- 추천자 목록: GET /board/posts/{id}/recommenders + PostDetail.recommenders
- 포인트: member.points + point_history. 글/댓글 작성 시 10P, 하루 3회 한도(합산).
PointService, GET /auth/points, MemberResponse.points 노출
- @MapperScan 에 point.mapper 추가, AuthController WebMvc 테스트 MockBean 보강
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -95,3 +95,23 @@ CREATE TABLE IF NOT EXISTS comment (
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_comment_post (post_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- 게시글 추천/비추천 (회원당 1표, UP/DOWN). 같은 표 재요청 시 취소, 반대면 전환.
|
||||
CREATE TABLE IF NOT EXISTS post_vote (
|
||||
post_id BIGINT NOT NULL,
|
||||
member_id BIGINT NOT NULL,
|
||||
vote_type VARCHAR(4) NOT NULL COMMENT 'UP / DOWN',
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (post_id, member_id),
|
||||
KEY idx_post_vote_post (post_id, vote_type)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
-- 댓글 추천/비추천 (회원당 1표)
|
||||
CREATE TABLE IF NOT EXISTS comment_vote (
|
||||
comment_id BIGINT NOT NULL,
|
||||
member_id BIGINT NOT NULL,
|
||||
vote_type VARCHAR(4) NOT NULL COMMENT 'UP / DOWN',
|
||||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (comment_id, member_id),
|
||||
KEY idx_comment_vote_comment (comment_id, vote_type)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
|
||||
Reference in New Issue
Block a user