feat(board): 스팸 키워드 자동 블라인드 및 관리자 신고 목록 노출
- BoardService: create/addComment에서 isSpam 감지 시 자동 블라인드 처리, 포인트 미지급 - ReportMapper: listReported 쿼리 확장 — 신고 누적 OR 스팸 감지 블라인드 항목 모두 포함 - ReportedItem: blockReason 필드 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
b3b42f0db6
commit
82eea0b908
@@ -19,6 +19,7 @@ public class ReportedItem {
|
||||
private Long authorId; // 작성자 id
|
||||
private String authorName; // 작성자 표시명
|
||||
private Boolean blocked; // 이미 블라인드 되었는지
|
||||
private String blockReason; // 블라인드 사유 (글만 존재; 스팸 감지 / 신고 누적 등)
|
||||
private Integer reportCount; // 누적 신고 수
|
||||
private LocalDateTime lastReportedAt; // 마지막 신고 시각
|
||||
}
|
||||
|
||||
@@ -191,7 +191,11 @@ public class BoardService {
|
||||
.build();
|
||||
postMapper.insert(post);
|
||||
applyTags(post.getId(), req.getTagIds());
|
||||
pointService.awardBoardWrite(author.getId(), req.getContent());
|
||||
if (pointService.isSpam(req.getContent())) {
|
||||
postMapper.updateBlocked(post.getId(), true, "스팸 키워드 감지");
|
||||
} else {
|
||||
pointService.awardBoardWrite(author.getId(), req.getContent());
|
||||
}
|
||||
return assemble(mustFindPost(post.getId()), author);
|
||||
}
|
||||
|
||||
@@ -245,7 +249,11 @@ public class BoardService {
|
||||
.content(req.getContent())
|
||||
.build();
|
||||
commentMapper.insert(comment);
|
||||
pointService.awardBoardWrite(author.getId(), req.getContent());
|
||||
if (pointService.isSpam(req.getContent())) {
|
||||
commentMapper.updateBlocked(comment.getId(), true);
|
||||
} else {
|
||||
pointService.awardBoardWrite(author.getId(), req.getContent());
|
||||
}
|
||||
return CommentResponse.from(commentMapper.findById(comment.getId()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user