@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
'메모장' 카테고리의 다른 글
RequestPart, RequestBody 같이 못씀 (0) | 2023.12.04 |
---|---|
포스트맨 파일 보내기 (0) | 2023.12.04 |
프로퍼티가 같다면 복사 (dto같은곳에 사용하면 좋을지도?) (0) | 2023.12.02 |
Error creating bean with name 'flywayInitializer'에러 났을 때 (0) | 2023.12.02 |
@QueryProjection으로 List초기화 하기 찾아보자 (0) | 2023.11.30 |