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

경기 조회 API #151

Merged
merged 17 commits into from
Apr 16, 2024
Merged

경기 조회 API #151

merged 17 commits into from
Apr 16, 2024

Conversation

enbraining
Copy link
Member

No description provided.

@enbraining enbraining requested a review from tlsgmltjd April 13, 2024 09:37
@enbraining enbraining self-assigned this Apr 13, 2024
@enbraining enbraining linked an issue Apr 13, 2024 that may be closed by this pull request
Comment on lines 72 to 78
betting.get().getBetPoint(),
matchResult.getTeamAScore(),
matchResult.getTeamBScore(),
betting.get().getBetScoreA(),
betting.get().getBetScoreB(),
match.getTeamABet(),
match.getTeamBBet()
Copy link
Contributor

Choose a reason for hiding this comment

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

배팅을 하지 않았다면 해당 값이 null로 나와서 NPE이 발생해요!

match.getTeamABet(),
match.getTeamBBet(),
matchResult.getTeamAScore(),
matchResult.getTeamAScore(),
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
matchResult.getTeamAScore(),
matchResult.getTeamBScore(),

B팀 점수인데 A팀 점수가 들어가네요!

Comment on lines 82 to 102
return new MatchResultDto(
match.getMatchId(),
match.getMatchType(),
match.getMatchLevel(),
match.getTeamA().getTeamId(),
match.getTeamA().getTeamName(),
match.getTeamAGrade(),
match.getTeamAClassType(),
match.getTeamB().getTeamId(),
match.getTeamB().getTeamName(),
match.getTeamBGrade(),
match.getTeamBClassType(),
betting.isPresent(),
match.getTeamABet(),
match.getTeamBBet(),
matchResult.getTeamAScore(),
matchResult.getTeamAScore(),
betting.get().getBetScoreA(),
betting.get().getBetScoreB(),
calculatePoint.getEarnedPoint(),
calculatePoint.getLosePoint()
Copy link
Contributor

Choose a reason for hiding this comment

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

이렇게 생성자에 많은 필드를 주입하는것 보다 buidler 패턴을 사용하는것이 좋을것 같아요!

Comment on lines +36 to +38
UserEntity currentUser = userFacade.getCurrentUser();
List<MatchEntity> matches = matchQueryDslRepository.findByMonthAndDay(month, day);
List<MatchResultEntity> matchResults = matchResultQueryDslRepository.findByMonthAndDay(month, day);
Copy link
Contributor

Choose a reason for hiding this comment

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

경시 시작 시간, 끝나는 시간 값을 이용하여

matches: 경기 시작 전 or 경기 중인 경기
matchResults: 경기 시간이 끝난 경기

이렇게 조회되도록 변경 부탁드려요! 현재 상황은 경기 시간이 끝난 경기가 하나 있는데 matchs와 matchResults 모두 하나씩 나옵니다!

시간을 계산하여 한 쪽에서만 나오도록 변경 부탁드려요!

@tlsgmltjd
Copy link
Contributor

{
            "match_id": 1,
            "match_type": "SOCCER",
            "match_level": "TRYOUT",
            "team_aid": 36,
            "team_aname": "팀8",
            "team_agrade": "ONE",
            "team_aclass_type": "SW",
            "team_bid": 37,
            "team_bname": "팀9",
            "team_bgrade": "TWO",
            "team_bclass_type": "SW",
            "team_abet": 50000,
            "team_bbet": 80000,
            "team_ascore": 2,
            "team_bscore": 2,
            "bet_team_ascore": 3,
            "bet_team_bscore": 2,
            "earned_point": 117000,
            "lose_point": null,
            "vote": true
        }

실제 json 값인데 명세서와 다른 부분이 다수 존재합니다! 해당 부분 수정 부탁드리고 도저히 안될것 같은 부분이 있다면 따로 디스코드로 공유 후에 명세서를 변경하여 맞춰주세요!

@enbraining enbraining merged commit 4b2e4c6 into main Apr 16, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

경기 조회 API
2 participants