From e17c1cd4bbaa59c380e9676b94871ef77f7cf761 Mon Sep 17 00:00:00 2001 From: mummhy0811 Date: Wed, 5 Jun 2024 13:07:11 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=EB=AA=A8=EC=9E=84=EC=84=9C=EB=B9=84?= =?UTF-8?q?=EC=8A=A4=20=EC=83=81=EC=84=B8=20=EC=84=A0=ED=98=B8=20=EC=97=AC?= =?UTF-8?q?=ED=96=89=20=EB=A6=AC=ED=84=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../triptogether/team/dto/response/DetailTeamResDto.java | 1 + .../triptogether/team/service/impl/TeamServiceImpl.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/hanaro/triptogether/team/dto/response/DetailTeamResDto.java b/src/main/java/com/hanaro/triptogether/team/dto/response/DetailTeamResDto.java index c2b73cb..b192308 100644 --- a/src/main/java/com/hanaro/triptogether/team/dto/response/DetailTeamResDto.java +++ b/src/main/java/com/hanaro/triptogether/team/dto/response/DetailTeamResDto.java @@ -14,4 +14,5 @@ public class DetailTeamResDto { private String accNumber; private BigDecimal accBalance; private TeamMemberState teamMemberState; + private Long preferTripIdx; } diff --git a/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java b/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java index a7f7a89..1fb6ee5 100644 --- a/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java +++ b/src/main/java/com/hanaro/triptogether/team/service/impl/TeamServiceImpl.java @@ -69,15 +69,14 @@ public DetailTeamResDto detailTeam(DetailTeamReqDto detailTeamReqDto) { Team team = teamRepository.findById(detailTeamReqDto.getTeamIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_NOT_FOUND)); TeamMember teamMember = teamMemberRepository.findById(detailTeamReqDto.getTeamMemberIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_MEMBER_NOT_FOUND)); - DetailTeamResDto detailTeamResDto = DetailTeamResDto.builder() + return DetailTeamResDto.builder() + .preferTripIdx(team.getPreferTrip().getTripIdx()) .teamNotice(team.getTeamNotice()) .teamName(team.getTeamName()) .accNumber(team.getAccount().getAccNumber()) .accBalance(team.getAccount().getAccBalance()) .teamMemberState(teamMember.getTeamMemberState()) .build(); - - return detailTeamResDto; } // 모임서비스 나가기 (전체 내보내기 후 모임 삭제) From 7e24df5ce6bafaf5f65551a2c3c1f58d83aa8d3e Mon Sep 17 00:00:00 2001 From: mummhy0811 Date: Wed, 5 Jun 2024 13:09:55 +0900 Subject: [PATCH 2/2] =?UTF-8?q?test:=20=EB=A6=AC=ED=84=B4=EA=B0=92=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80=EC=97=90=20=EB=94=B0=EB=A5=B8=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hanaro/triptogether/TeamServiceTests.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/com/hanaro/triptogether/TeamServiceTests.java b/src/test/java/com/hanaro/triptogether/TeamServiceTests.java index 8b22831..9882eb8 100644 --- a/src/test/java/com/hanaro/triptogether/TeamServiceTests.java +++ b/src/test/java/com/hanaro/triptogether/TeamServiceTests.java @@ -12,6 +12,7 @@ import com.hanaro.triptogether.team.service.impl.TeamServiceImpl; import com.hanaro.triptogether.teamMember.domain.TeamMember; import com.hanaro.triptogether.teamMember.domain.TeamMemberRepository; +import com.hanaro.triptogether.trip.domain.Trip; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -51,6 +52,7 @@ public class TeamServiceTests { private Long memberIdx = 1L; private TeamMember teamMember; private Long teamMemberIdx = 1L; + private Trip trip; @BeforeEach void setUp() { @@ -75,6 +77,10 @@ void setUp() { .createdAt(LocalDateTime.now()) .build(); + trip = Trip.builder() + .tripIdx(1L) + .build(); + team = Team.builder() .teamIdx(teamIdx) .account(account) @@ -82,6 +88,7 @@ void setUp() { .preferenceType(PreferenceType.해외) .teamNotice("Team Notice") .createdAt(LocalDateTime.now()) + .preferTrip(trip) .build(); teamMember = TeamMember.builder()