1212import com .back .domain .post .post .repository .PostRepository ;
1313import com .back .domain .user .entity .User ;
1414import com .back .global .rq .Rq ;
15+ import com .back .domain .user .service .AbvScoreService ;
1516import java .util .List ;
1617import lombok .RequiredArgsConstructor ;
1718import org .springframework .stereotype .Service ;
@@ -25,6 +26,7 @@ public class CommentService {
2526 private final PostRepository postRepository ;
2627 private final NotificationService notificationService ;
2728 private final Rq rq ;
29+ private final AbvScoreService abvScoreService ;
2830
2931 // 댓글 작성 로직
3032 @ Transactional
@@ -48,7 +50,10 @@ public CommentResponseDto createComment(Long postId, CommentCreateRequestDto req
4850 user .getNickname () + " 님이 댓글을 남겼습니다."
4951 );
5052
51- return new CommentResponseDto (commentRepository .save (comment ));
53+ Comment saved = commentRepository .save (comment );
54+ // 활동 점수: 댓글 작성 +0.2
55+ abvScoreService .awardForComment (user .getId ());
56+ return new CommentResponseDto (saved );
5257 }
5358
5459 // 댓글 다건 조회 로직 (무한스크롤)
@@ -102,6 +107,8 @@ public void deleteComment(Long postId, Long commentId) {
102107 }
103108
104109 comment .updateStatus (CommentStatus .DELETED );
110+ // 활동 점수: 댓글 삭제 시 -0.2 (작성자 기준)
111+ abvScoreService .revokeForComment (user .getId ());
105112
106113 // soft delete를 사용하기 위해 레포지토리 삭제 작업은 진행하지 않음.
107114// commentRepository.delete(comment);
0 commit comments