-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat : 레이싱 게임 당첨자 추첨 기능 구현 (CC-125) #20
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~~
@@ -38,4 +43,9 @@ public ResponseEntity<SuccessResponse<Object>> registerRacingGame(@RequestBody R | |||
racingGameService.registerRacingGameInfo(req); | |||
return SuccessResponse.of(SuccessCode.RACING_GAME_CREATED); | |||
} | |||
|
|||
@PostMapping("/racing/draw") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET이 맞을 것 같은데 POST인 이유가 있나요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GET은 자원을 요청하고, POST는 사용자 요청을 통해 서버에 자원을 생성하는 느낌으로 작성했습니다.
해당 기능은 추첨자를 뽑고 추첨된 인원들을 반환하는 API이고, 추첨된 인원들만 반환하는 API는 따로 작성할 계획입니다.
@Transactional | ||
public List<DrawResponseDto> drawRacingGameWinner() { | ||
List<DrawResponseDto> drawResponseDtoList = new ArrayList<>(); | ||
List<RacingGameParticipant> participants = racingGameRepository.findAllByAdjustedDistance(315.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
315, 가중치, 퍼센테이지 같은건 상수로 관리하는게 어떤가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
동의합니다. 잠시 동작확인을 위해 상수로 넣어놨습니다. 전체적인 글로벌 변수를 관리하는 자바 파일을 논의 후 만들어보죠
|
||
@AllArgsConstructor | ||
@NoArgsConstructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
빌더 패턴을 사용하지 않은 무분별한 객체 생성을 막기 위해 (accessLevel = protected) 붙여주세용
📝 작업내용
💬 침고사항
📖 레퍼런스