feat: 게시판 공지 기능 (관리자) — 목록 최상단 고정
- post.notice 컬럼 추가(멱등 ALTER)
- 목록 정렬 ORDER BY notice DESC, id DESC (공지 최상단)
- 작성 시 공지 설정(관리자만 반영) + /posts/{id}/notice·unnotice 토글
- Post/PostSummary/PostDetail/PostRequest 에 notice 반영
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
b48d8c667c
commit
8d8d26ec3a
@@ -99,6 +99,24 @@ public class BoardController {
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
/** 공지 등록 (관리자) — 목록 최상단 고정 */
|
||||
@PostMapping("/posts/{id}/notice")
|
||||
public ResponseEntity<Void> notice(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute(AuthInterceptor.CURRENT_MEMBER) SessionUser current) {
|
||||
boardService.setNotice(id, true, current);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
/** 공지 해제 (관리자) */
|
||||
@PostMapping("/posts/{id}/unnotice")
|
||||
public ResponseEntity<Void> unnotice(
|
||||
@PathVariable Long id,
|
||||
@RequestAttribute(AuthInterceptor.CURRENT_MEMBER) SessionUser current) {
|
||||
boardService.setNotice(id, false, current);
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
@GetMapping("/tags")
|
||||
public List<String> tags() {
|
||||
return boardService.allTags();
|
||||
|
||||
Reference in New Issue
Block a user