- POST /board/comments/{id}/unblock (관리자) — 댓글 블라인드 해제
- 글/댓글 블라인드 해제 시 신고 기록 삭제(재블라인드 방지)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -196,4 +196,13 @@ public class BoardController {
|
||||
boardService.reportComment(commentId, current);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
/** 댓글 블라인드 해제 (관리자) */
|
||||
@PostMapping("/comments/{commentId}/unblock")
|
||||
public ResponseEntity<Void> unblockComment(
|
||||
@PathVariable Long commentId,
|
||||
@RequestAttribute(AuthInterceptor.CURRENT_MEMBER) SessionUser current) {
|
||||
boardService.unblockComment(commentId, current);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +125,22 @@ public class BoardService {
|
||||
assertAdmin(user);
|
||||
mustFindPost(id);
|
||||
postMapper.updateBlocked(id, blocked, blocked ? reason : null);
|
||||
// 해제 시 신고 기록 초기화 → 다음 신고 1건에 곧바로 재블라인드되지 않게
|
||||
if (!blocked) {
|
||||
reportMapper.deleteByTarget(T_POST, id);
|
||||
}
|
||||
}
|
||||
|
||||
/** 댓글 블라인드 해제 (관리자 전용) — 신고 기록 초기화 */
|
||||
@Transactional
|
||||
public void unblockComment(Long commentId, SessionUser user) {
|
||||
assertAdmin(user);
|
||||
Comment comment = commentMapper.findById(commentId);
|
||||
if (comment == null) {
|
||||
throw new ApiException(HttpStatus.NOT_FOUND, "댓글을 찾을 수 없습니다.");
|
||||
}
|
||||
commentMapper.updateBlocked(commentId, false);
|
||||
reportMapper.deleteByTarget(T_COMMENT, commentId);
|
||||
}
|
||||
|
||||
/** 게시글 공지 설정/해제 (관리자 전용) — 목록 최상단 고정 */
|
||||
|
||||
Reference in New Issue
Block a user