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

✨ [Feature] 토너먼트 게임 매칭 로직 추가 #404

Merged
merged 47 commits into from
Dec 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
12211ae
:sparkles: feat: TournamentRound roundNumber 및 메서드 추가
Kimhan-nah Dec 13, 2023
f4b4b76
:sparkles: feat: Game의 getWinnerTeam 함수 추가
Kimhan-nah Dec 13, 2023
b8c2636
:sparkles: feat: 같은 round의 토너먼트 게임 반환 함수 추가
Kimhan-nah Dec 13, 2023
3290182
:sparkles: feat: 토너먼트 매칭 로직 추가
Kimhan-nah Dec 13, 2023
a305b87
:bug: fix: GameController 테스트에 tournament game 데이터 생성 추가
Kimhan-nah Dec 13, 2023
238498a
:bug: fix: 같은 round의 모든 game 반환하도록 filter 조건 수정
Kimhan-nah Dec 13, 2023
6ecfdd7
:test_tube: test: MathTournamentTest 추가
Kimhan-nah Dec 13, 2023
90aad10
:sparkles: feat: 토너먼트 게임 결과 수정에 매칭 로직 추가
Kimhan-nah Dec 13, 2023
a3b9dce
:hammer: refactor: return type Optional로 수정
Kimhan-nah Dec 15, 2023
e68a941
:hammer: refactor: 결승전 roundNum 2로 수정
Kimhan-nah Dec 15, 2023
c463656
:hammer: refactor: TeamUser에 updateUser 추가
Kimhan-nah Dec 15, 2023
044bea5
:sparkles: feat: TournamentMatch Enum class 생성
Kimhan-nah Dec 15, 2023
266ac3a
:sparkles: feat: 토너먼트 다음 경기의 플레이어 수정 함수 추가
Kimhan-nah Dec 15, 2023
9ddff39
:hammer: refactor: 토너먼트 매칭 함수 호출 수정
Kimhan-nah Dec 15, 2023
d5563f0
:test_tube: test: MatchTestUtils에 중복된 함수 리팩토링
Kimhan-nah Dec 15, 2023
b281c95
:hammer: refactor: MatchTestUtils util 폴더로 이동
Kimhan-nah Dec 16, 2023
cdc7782
:hammer: refactor: test util 및 토너먼트 결과 수정 테스트 코드 수정
Kimhan-nah Dec 16, 2023
1621c1d
:bug: fix: 중복된 touranment game repository 삭제
Kimhan-nah Dec 16, 2023
d03d55e
:bug: fix: match test util 파일 이동으로 인한 import 수정
Kimhan-nah Dec 16, 2023
f1e62fc
:test_tube: test: 매칭되어 있는 다음 경기의 팀 수정 테스트 추가
Kimhan-nah Dec 16, 2023
7f97e22
:hammer: refactor: TournamentMatchStatus enum 클래스명 수정
Kimhan-nah Dec 16, 2023
0e4152e
:hammer: refactor: tournament match status 수정
Kimhan-nah Dec 16, 2023
2d08c0b
:sparkles: feat: 토너먼트 슬롯 블락 시간 interval 고려하여 블락
Kimhan-nah Dec 16, 2023
f7b169d
:bug: fix: 게임 매칭할 때 시작 시간 라운드별 다르게 수정
Kimhan-nah Dec 16, 2023
65ca622
:hammer: refactor: exception errorCode 일치하도록 수정
Kimhan-nah Dec 16, 2023
682a80d
:sparkles: feat: TeamNotFoundException 추가
Kimhan-nah Dec 16, 2023
7c372af
:hammer: refactor: custom exception으로 수정
Kimhan-nah Dec 16, 2023
ed9c70b
:bug: fix: updateMatchedGameUser 테스트 fail 수정
Kimhan-nah Dec 16, 2023
ad6ad63
:bug: fix: 라운드별 match game의 team user가 비정상적인 문제 수정
Kimhan-nah Dec 16, 2023
744bacb
:sparkles: feat: 우승팀 not found exception 추가
Kimhan-nah Dec 17, 2023
420915b
:bug: fix: user id와 team id를 비교하는 잘못된 로직 수정
Kimhan-nah Dec 17, 2023
23418cd
:hammer: refactor: updateMatchedGameUser 파라미터명 수정
Kimhan-nah Dec 17, 2023
d92b4a2
:test_tube: test: 우승팀 존재하지 않는 실패 케이스 추가
Kimhan-nah Dec 17, 2023
eec69d7
:test_tube: test: 이미 매칭된 게임 존재하는 실패 케이스 추가
Kimhan-nah Dec 17, 2023
dcb5147
:test_tube: test: checkTournamentGame return 값 테스트 추가
Kimhan-nah Dec 17, 2023
4a3643a
:green_heart: chore: QA를 위한 스케줄러 주기 임시 변경
Kimhan-nah Dec 17, 2023
103e7ae
:hammer: refactor: MatchTournamentService에 Transactional 추가
Kimhan-nah Dec 17, 2023
dada981
:bug: fix: 연관관계 메서드 수정으로 인한 add 삭제
Kimhan-nah Dec 17, 2023
10abb2a
:hammer: refactor: 불필요한 enum의 get 함수 삭제
Kimhan-nah Dec 17, 2023
f88fd69
:hammer: refactor: updateUser에 null check 추가
Kimhan-nah Dec 17, 2023
2cf7bae
:bug: fix: 사용중인 enum 메서드 되돌리기
Kimhan-nah Dec 17, 2023
c88c77b
:hammer: refactor: getWinningTeam() game에서 service 이동
Kimhan-nah Dec 17, 2023
6026e32
:bug: fix: 메서드 이동에 따른 에러 수정
Kimhan-nah Dec 17, 2023
f7221b1
:hammer: refactor: 불필요한 enum 메서드 삭제
Kimhan-nah Dec 17, 2023
09b9ace
:hammer: refactor: exception throw 추가
Kimhan-nah Dec 17, 2023
8edd7cb
:hammer: refactor: 매칭 첫 경기의 시작시간 계산 수정
Kimhan-nah Dec 18, 2023
54a34b6
:bug: fix: 스케줄러 cron 수정
Kimhan-nah Dec 18, 2023
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
Prev Previous commit
Next Next commit
✨ feat: 토너먼트 게임 결과 수정에 매칭 로직 추가
MatchTournamentService 추가
Kimhan-nah committed Dec 18, 2023

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tvdeyen Thomas von Deyen
commit 90aad10bd2b9fc64a64c3737198e76269150d216
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import com.gg.server.domain.game.data.GameRepository;
import com.gg.server.domain.game.exception.ScoreNotInvalidException;
import com.gg.server.domain.game.type.StatusType;
import com.gg.server.domain.match.service.MatchTournamentService;
import com.gg.server.domain.team.data.Team;
import com.gg.server.domain.tournament.data.*;
import com.gg.server.domain.tournament.dto.TournamentUserListResponseDto;
@@ -34,6 +35,7 @@ public class TournamentAdminService {
private final UserRepository userRepository;
private final GameRepository gameRepository;
private final TournamentGameRepository tournamentGameRepository;
private final MatchTournamentService matchTournamentService;

/***
* 토너먼트 생성 Method
@@ -301,7 +303,7 @@ private void updateTeamScore(Game game, TournamentGameUpdateRequestDto reqDto){
team1.updateScore(reqDto.getTeam1().getScore(), reqDto.getTeam1().getScore() > reqDto.getTeam2().getScore());
team2.updateScore(reqDto.getTeam2().getScore(), reqDto.getTeam2().getScore() > reqDto.getTeam1().getScore());
if (game.getStatus() == StatusType.LIVE || game.getStatus() == StatusType.WAIT){
// todo 매칭 시스템 로직 추가
matchTournamentService.checkTournamentGame(game);
}
if (game.getStatus() == StatusType.LIVE){
game.updateStatus();