Skip to content
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

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

putdata
Copy link
Collaborator

@putdata putdata commented Aug 7, 2024

📝 작업내용

  • 추첨기능 간단하게 구현

💬 침고사항

📖 레퍼런스

@putdata putdata self-assigned this Aug 7, 2024
Copy link
Collaborator

@j2noo j2noo left a 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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GET이 맞을 것 같은데 POST인 이유가 있나요!

Copy link
Collaborator Author

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);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

315, 가중치, 퍼센테이지 같은건 상수로 관리하는게 어떤가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

동의합니다. 잠시 동작확인을 위해 상수로 넣어놨습니다. 전체적인 글로벌 변수를 관리하는 자바 파일을 논의 후 만들어보죠


@AllArgsConstructor
@NoArgsConstructor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

빌더 패턴을 사용하지 않은 무분별한 객체 생성을 막기 위해 (accessLevel = protected) 붙여주세용

@j2noo j2noo merged commit 6828bd0 into develop Aug 8, 2024
1 check passed
@j2noo j2noo deleted the CC-125 branch August 8, 2024 01:43
@putdata putdata added 익준 feat📌 기능 개발 labels Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat📌 기능 개발 익준
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants