JsonInclude의 속성
ALWAYS(default) 모든 값을 출력
NON-NULL - NULL은 제외
NON_ABSENT - NULL은 제외, 참조 유형의 "absent" 값 ;
NON_EMPTY - NULL 제외, absent 제외, Collection, Map 의 isEmpty()가 true면 제외, Array, String의 length가 0이면 제외
NON_DEFAULT - empty는 제외, primitive 타입이 디폴트 값이면 제외, Date의 timestamp가 0L이면 제외
등
@AuthenticationPrincipal UserDetailsImpl userDetails
User user = userDetails.getUser(); 과 같은 것으로 SecurityContextHolder에서 현재 로그인한 유저 정보를 가져올 수 있다.
'TIL' 카테고리의 다른 글
| [TIL]2023-09-11 (0) | 2023.09.11 |
|---|---|
| [TIL]2023-09-08 (0) | 2023.09.08 |
| [TIL]2023-09-06 (0) | 2023.09.06 |
| [TIL]2023-09-05 (0) | 2023.09.05 |
| [TIL]2023-09-04 (1) | 2023.09.04 |