From 770fabfa528ed53f21bc375e44ebfbf217705e61 Mon Sep 17 00:00:00 2001 From: yumzen Date: Tue, 24 Sep 2024 01:05:43 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[#238]=20fix:=20=EC=A1=B0=ED=9A=8C=EC=88=98?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/gongjakso/server/domain/team/service/TeamService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java b/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java index 06b1f04..3334fab 100644 --- a/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java +++ b/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java @@ -172,6 +172,8 @@ public TeamRes getTeam(Member member, Long contestId, Long teamId, HttpServletRe throw new ApplicationException(ErrorCode.TEAM_NOT_FOUND_EXCEPTION); } + updateView(team, request, response); + if(member != null && team.getMember().getId().equals(member.getId())){ return TeamRes.of(team, "LEADER"); }else if(member != null && applyRepository.findByTeamIdAndMemberIdAndDeletedAtIsNull(teamId, member.getId()).isPresent()){ @@ -180,8 +182,6 @@ public TeamRes getTeam(Member member, Long contestId, Long teamId, HttpServletRe return TeamRes.of(team, "APPLIER", apply); } - updateView(team, request, response); - // Business Logic return TeamRes.of(team, "GENERAL"); } From ab3816ad1bbcf23bedce27803a4859a06241576b Mon Sep 17 00:00:00 2001 From: yumzen Date: Tue, 24 Sep 2024 01:07:39 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[#238]=20fix:=20passCount=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gongjakso/server/domain/team/service/TeamService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java b/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java index 3334fab..768d539 100644 --- a/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java +++ b/src/main/java/com/gongjakso/server/domain/team/service/TeamService.java @@ -174,6 +174,8 @@ public TeamRes getTeam(Member member, Long contestId, Long teamId, HttpServletRe updateView(team, request, response); + updatePassCount(team); + if(member != null && team.getMember().getId().equals(member.getId())){ return TeamRes.of(team, "LEADER"); }else if(member != null && applyRepository.findByTeamIdAndMemberIdAndDeletedAtIsNull(teamId, member.getId()).isPresent()){ @@ -342,4 +344,9 @@ public void updateView(Team team, HttpServletRequest request, HttpServletRespons response.addCookie(newCookie); } } + + public void updatePassCount(Team team) { + int passCount = applyRepository.countByTeamIdAndStatusAndDeletedAtIsNull(team.getId(), ApplyStatus.ACCEPTED); + team.updatePassCount(passCount); + } }