feat(point): 게시판 포인트 정책 개편

작성: 10P, 일 50P 한도(5회), 스팸 키워드 포함 시 미지급
추천 받음(작성자): +5P, 일 50P 한도
비추천 받음(작성자): -1P
남의 글 추천(투표자): +1P, 일 10P 한도
추천 취소(투표자): -1P
addPoints에 GREATEST(0,...) 적용 — 잔액 음수 방지
This commit is contained in:
ByungCheol
2026-07-05 12:38:40 +09:00
parent d65dd88bba
commit 32da57e0e0
3 changed files with 109 additions and 17 deletions
@@ -191,7 +191,7 @@ public class BoardService {
.build();
postMapper.insert(post);
applyTags(post.getId(), req.getTagIds());
pointService.awardBoardWrite(author.getId()); // 글 작성 보상(일 3회 한도)
pointService.awardBoardWrite(author.getId(), req.getContent());
return assemble(mustFindPost(post.getId()), author);
}
@@ -245,7 +245,7 @@ public class BoardService {
.content(req.getContent())
.build();
commentMapper.insert(comment);
pointService.awardBoardWrite(author.getId()); // 댓글 작성 보상(일 3회 한도, 글과 합산)
pointService.awardBoardWrite(author.getId(), req.getContent());
return CommentResponse.from(commentMapper.findById(comment.getId()));
}
@@ -328,6 +328,7 @@ public class BoardService {
} else {
voteMapper.upsertPostVote(postId, memberId, type);
}
pointService.applyVotePoints(post.getAuthorId(), memberId, existing, type);
return new VoteResponse(
voteMapper.countPostVotes(postId, UP),
voteMapper.countPostVotes(postId, DOWN),
@@ -352,6 +353,7 @@ public class BoardService {
} else {
voteMapper.upsertCommentVote(commentId, memberId, type);
}
pointService.applyVotePoints(comment.getAuthorId(), memberId, existing, type);
return new VoteResponse(
voteMapper.countCommentVotes(commentId, UP),
voteMapper.countCommentVotes(commentId, DOWN),