@@ -120,10 +120,18 @@ public class BoardController {
|
|||||||
return ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** 목록 태그 필터 — 게시판 지정 시 그 게시판에 매핑된 그룹의 태그만 */
|
||||||
@GetMapping("/tags")
|
@GetMapping("/tags")
|
||||||
public List<String> tags() {
|
public List<String> tags(@RequestParam(required = false) String category) {
|
||||||
|
if (category == null || category.isBlank()) {
|
||||||
return boardService.allTags();
|
return boardService.allTags();
|
||||||
}
|
}
|
||||||
|
return tagService.listWritableGroups(category).stream()
|
||||||
|
.flatMap(g -> g.getTags().stream())
|
||||||
|
.map(com.sb.web.board.dto.TagResponse::getName)
|
||||||
|
.distinct()
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
/** 글 작성 시 선택 가능한 태그 (해당 게시판에 매핑된 그룹만) */
|
/** 글 작성 시 선택 가능한 태그 (해당 게시판에 매핑된 그룹만) */
|
||||||
@GetMapping("/tag-groups")
|
@GetMapping("/tag-groups")
|
||||||
|
|||||||
Reference in New Issue
Block a user