| | |
| | | */ |
| | | public CurrentJudgeRatingResponse getCurrentJudgeRating(Long activityPlayerId) { |
| | | Long currentJudgeId = userContextUtil.getCurrentJudgeId(); |
| | | log.info("getCurrentJudgeRating - activityPlayerId: {}, currentJudgeId: {}", activityPlayerId, currentJudgeId); |
| | | |
| | | if (currentJudgeId == null) { |
| | | log.warn("getCurrentJudgeRating - currentJudgeId is null"); |
| | | return null; |
| | | } |
| | | |
| | |
| | | .findByActivityPlayerIdAndJudgeId(activityPlayerId, currentJudgeId); |
| | | |
| | | if (!ratingOpt.isPresent()) { |
| | | log.info("getCurrentJudgeRating - No rating found for activityPlayerId: {} and judgeId: {}", activityPlayerId, currentJudgeId); |
| | | return null; |
| | | } |
| | | |
| | | log.info("getCurrentJudgeRating - Found rating with id: {}", ratingOpt.get().getId()); |
| | | |
| | | ActivityPlayerRating rating = ratingOpt.get(); |
| | | CurrentJudgeRatingResponse response = new CurrentJudgeRatingResponse(); |
| | | response.setId(rating.getId()); |