Merge branch 'dev'
Deploy / deploy (push) Successful in 53s

This commit is contained in:
ByungCheol
2026-06-28 18:16:58 +09:00
2 changed files with 25 additions and 0 deletions
@@ -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);
}
/** 게시글 공지 설정/해제 (관리자 전용) — 목록 최상단 고정 */