메모장

@AuthenticationPrincipal

키스샷1104 2023. 12. 2. 21:39
@GetMapping
public ResponseEntity getArticles(
    @RequestParam(value = "offset", defaultValue = "0") int offset,
    @RequestParam(value = "limit", defaultValue = "20") int limit,
    @RequestParam(value = "tag", required = false) String tag,
    @RequestParam(value = "favorited", required = false) String favoritedBy,
    @RequestParam(value = "author", required = false) String author,
    @AuthenticationPrincipal User user) {
  return ResponseEntity.ok(
      articleQueryService.findRecentArticles(
          tag, author, favoritedBy, new Page(offset, limit), user));
}

@AuthenticationPrincipal