Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ class RecordRankingController(
@GetMapping("course/{courseId}/ranking/me")
@ResponseStatus(HttpStatus.OK)
fun getMyRanking(
@UserId userId: Long,
// UserIdResolver#supportsParameter가 boxed java.lang.Long만 매칭한다.
// Kotlin의 non-null Long은 바이트코드상 primitive long으로 컴파일되어
// 리졸버가 파라미터를 아예 인식하지 못하므로, 반드시 nullable(Long?)로 선언해
// boxed Long으로 컴파일되게 한다. 실제로 null이 들어오는 경우는 없다 —
// 리졸버가 토큰이 없거나 유효하지 않으면 예외를 던진다.
@UserId userId: Long?,
@PathVariable courseId: Long,
) = ApiResponseDto.success(
SuccessStatus.GET_MY_RECORD_RANKING_SUCCESS,
recordRankingService.getMyRanking(courseId, userId),
recordRankingService.getMyRanking(courseId, requireNotNull(userId)),
)
}
Loading