feat: 게시판 추천/비추천 + 작성자 아바타 + 추천자 + 활동 포인트
- 작성자 아바타: 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:
co-authored by
Claude Opus 4.8
parent
98f5f51112
commit
ef9dace1df
@@ -8,7 +8,10 @@ import com.sb.web.board.dto.PageResponse;
|
||||
import com.sb.web.board.dto.PostDetail;
|
||||
import com.sb.web.board.dto.PostRequest;
|
||||
import com.sb.web.board.dto.PostSummary;
|
||||
import com.sb.web.board.dto.Recommender;
|
||||
import com.sb.web.board.dto.TagCategoryResponse;
|
||||
import com.sb.web.board.dto.VoteRequest;
|
||||
import com.sb.web.board.dto.VoteResponse;
|
||||
import com.sb.web.board.service.BoardService;
|
||||
import com.sb.web.board.service.TagService;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -143,4 +146,28 @@ public class BoardController {
|
||||
boardService.deleteComment(commentId, current);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
/** 게시글 추천/비추천 (토글) */
|
||||
@PostMapping("/posts/{id}/vote")
|
||||
public VoteResponse votePost(
|
||||
@PathVariable Long id,
|
||||
@Valid @RequestBody VoteRequest req,
|
||||
@RequestAttribute(AuthInterceptor.CURRENT_MEMBER) SessionUser current) {
|
||||
return boardService.votePost(id, req.getType(), current);
|
||||
}
|
||||
|
||||
/** 게시글 추천(👍)한 사람 목록 */
|
||||
@GetMapping("/posts/{id}/recommenders")
|
||||
public List<Recommender> recommenders(@PathVariable Long id) {
|
||||
return boardService.recommenders(id);
|
||||
}
|
||||
|
||||
/** 댓글 추천/비추천 (토글) */
|
||||
@PostMapping("/comments/{commentId}/vote")
|
||||
public VoteResponse voteComment(
|
||||
@PathVariable Long commentId,
|
||||
@Valid @RequestBody VoteRequest req,
|
||||
@RequestAttribute(AuthInterceptor.CURRENT_MEMBER) SessionUser current) {
|
||||
return boardService.voteComment(commentId, req.getType(), current);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user