From b7d28278c8db793b9133ee50837bbf5a2698aee1 Mon Sep 17 00:00:00 2001 From: ShinKwang2 <71647602+ShinKwang2@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:30:33 +0900 Subject: [PATCH 01/11] Update gradle.yml Add firebase file for FCM --- .github/workflows/gradle.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 5f3d9ff..35fe08d 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -44,6 +44,8 @@ jobs: cd ./src/main/resources touch ./application.properties echo "${{ secrets.PROPERTIES }}" > ./application.properties + touch ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json + echo "${{ secrets.FIREBASE_KEY }}" > ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json shell: bash - name: Grant execute permission to Gradle wrapper @@ -100,4 +102,4 @@ jobs: author_name: 'SERVER CI/CD' fields: 'Job ID: ${{ github.run_id }} SUCCEEDED' env: - SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} From b423c56a9860179f57db0dd5604c03e95e6afbad Mon Sep 17 00:00:00 2001 From: lcw729 Date: Fri, 7 Jun 2024 11:16:05 +0900 Subject: [PATCH 02/11] =?UTF-8?q?feat:=20=EC=97=AC=ED=96=89=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20=EC=98=88=EC=83=81=20=EB=B9=84=EC=9A=A9=20=EB=B0=98?= =?UTF-8?q?=EC=98=81=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/hanaro/triptogether/trip/domain/Trip.java | 4 ++++ .../com/hanaro/triptogether/trip/domain/TripRepository.java | 4 ++-- .../hanaro/triptogether/trip/dto/response/TripResDto.java | 1 + .../com/hanaro/triptogether/trip/service/TripService.java | 6 ++++-- .../triptogether/tripPlace/service/TripPlaceService.java | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/hanaro/triptogether/trip/domain/Trip.java b/src/main/java/com/hanaro/triptogether/trip/domain/Trip.java index 6a1d141..a2e4707 100644 --- a/src/main/java/com/hanaro/triptogether/trip/domain/Trip.java +++ b/src/main/java/com/hanaro/triptogether/trip/domain/Trip.java @@ -37,6 +37,9 @@ public class Trip { @Column(nullable = false, precision = 20, scale = 2) private BigDecimal tripGoalAmount = BigDecimal.ZERO; + @Column(nullable = false, precision = 20, scale = 2) + private BigDecimal tripExpectedAmount = BigDecimal.ZERO; + @Column(nullable = false) private Integer tripDay = 1; @@ -74,6 +77,7 @@ public TripResDto toTrip() { .tripDay(this.getTripDay()) .tripContent(this.getTripContent()) .tripGoalAmount(this.getTripGoalAmount()) + .tripExpectedAmount(this.getTripExpectedAmount()) .tripName(this.getTripName()) .tripStartDay(this.getTripStartDay()) .build(); diff --git a/src/main/java/com/hanaro/triptogether/trip/domain/TripRepository.java b/src/main/java/com/hanaro/triptogether/trip/domain/TripRepository.java index ea2fb31..6820dec 100644 --- a/src/main/java/com/hanaro/triptogether/trip/domain/TripRepository.java +++ b/src/main/java/com/hanaro/triptogether/trip/domain/TripRepository.java @@ -13,6 +13,6 @@ public interface TripRepository extends JpaRepository { List findAllByTeam_TeamIdx(Long teamIdx); @Modifying - @Query("UPDATE Trip t SET t.tripGoalAmount = :goalAmount WHERE t.tripIdx = :tripIdx") - void updateGoalAmount(@Param("tripIdx") Long tripIdx, @Param("goalAmount") BigDecimal goalAmount); + @Query("UPDATE Trip t SET t.tripExpectedAmount = :tripExpectedAmount WHERE t.tripIdx = :tripIdx") + void updateExpectedAmount(@Param("tripIdx") Long tripIdx, @Param("tripExpectedAmount") BigDecimal expectedAmount); } diff --git a/src/main/java/com/hanaro/triptogether/trip/dto/response/TripResDto.java b/src/main/java/com/hanaro/triptogether/trip/dto/response/TripResDto.java index d4be00d..bd9d44d 100644 --- a/src/main/java/com/hanaro/triptogether/trip/dto/response/TripResDto.java +++ b/src/main/java/com/hanaro/triptogether/trip/dto/response/TripResDto.java @@ -18,6 +18,7 @@ public class TripResDto { private String tripName; private String tripContent; private BigDecimal tripGoalAmount; + private BigDecimal tripExpectedAmount; private Integer tripDay; private Integer tripImg; private LocalDate tripStartDay; diff --git a/src/main/java/com/hanaro/triptogether/trip/service/TripService.java b/src/main/java/com/hanaro/triptogether/trip/service/TripService.java index da1352d..41f27f3 100644 --- a/src/main/java/com/hanaro/triptogether/trip/service/TripService.java +++ b/src/main/java/com/hanaro/triptogether/trip/service/TripService.java @@ -143,6 +143,7 @@ private TripResDto toTripResDto(Trip trip) { .tripDay(trip.getTripDay()) .tripContent(trip.getTripContent()) .tripGoalAmount(trip.getTripGoalAmount()) + .tripExpectedAmount(trip.getTripExpectedAmount()) .tripName(trip.getTripName()) .tripStartDay(trip.getTripStartDay()) .build(); @@ -156,6 +157,7 @@ private TripResDto toTripResDto(Trip trip) { .tripDay(trip.getTripDay()) .tripContent(trip.getTripContent()) .tripGoalAmount(trip.getTripGoalAmount()) + .tripExpectedAmount(trip.getTripExpectedAmount()) .tripName(trip.getTripName()) .tripStartDay(trip.getTripStartDay()) .countryIdx(country.getCountryIdx()) @@ -166,9 +168,9 @@ private TripResDto toTripResDto(Trip trip) { } @Transactional - public void setGoalAmount(Long tripIdx, BigDecimal goalAmount) { + public void setExpectedAmount(Long tripIdx, BigDecimal expectedAmount) { Trip trip = tripRepository.findById(tripIdx) .orElseThrow(() -> new ApiException(ExceptionEnum.TRIP_NOT_FOUND)); - tripRepository.updateGoalAmount(tripIdx, goalAmount); + tripRepository.updateExpectedAmount(tripIdx, expectedAmount); } } diff --git a/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java b/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java index 1237963..820472c 100644 --- a/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java +++ b/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java @@ -74,7 +74,7 @@ public void updatePlace(Long trip_placeIdx, TripPlaceUpdateInfoReqDto dto) { Long tripIdx = tripPlace.getTrip().getTripIdx(); //goalAmount 계산 및 설정 - tripService.setGoalAmount(tripIdx, tripPlaceRepository.getSumPlaceAmountByTripIdx(tripIdx)); + tripService.setExpectedAmount(tripIdx, tripPlaceRepository.getSumPlaceAmountByTripIdx(tripIdx)); } @Transactional @@ -180,7 +180,7 @@ public void updateTripPlace(Long tripIdx, TripPlaceUpdateReqDto reqDto) { } //goalAmount 계산 및 설정 - tripService.setGoalAmount(tripIdx, tripPlaceRepository.getSumPlaceAmountByTripIdx(tripIdx)); + tripService.setExpectedAmount(tripIdx, tripPlaceRepository.getSumPlaceAmountByTripIdx(tripIdx)); } From b849d8371fc82a2c1c28b9ecea6a2fec5c2aebc3 Mon Sep 17 00:00:00 2001 From: lcw729 Date: Fri, 7 Jun 2024 11:31:49 +0900 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20=EC=97=AC=ED=96=89=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=20=EA=B0=92=20=EB=B0=98=ED=99=98=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hanaro/triptogether/trip/service/TripService.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/hanaro/triptogether/trip/service/TripService.java b/src/main/java/com/hanaro/triptogether/trip/service/TripService.java index 41f27f3..f99dcfb 100644 --- a/src/main/java/com/hanaro/triptogether/trip/service/TripService.java +++ b/src/main/java/com/hanaro/triptogether/trip/service/TripService.java @@ -141,6 +141,7 @@ private TripResDto toTripResDto(Trip trip) { .teamName(trip.getTeam().getTeamName()) .tripIdx(trip.getTripIdx()) .tripDay(trip.getTripDay()) + .tripImg(trip.getTripImg()) .tripContent(trip.getTripContent()) .tripGoalAmount(trip.getTripGoalAmount()) .tripExpectedAmount(trip.getTripExpectedAmount()) @@ -155,6 +156,7 @@ private TripResDto toTripResDto(Trip trip) { .teamName(trip.getTeam().getTeamName()) .tripIdx(trip.getTripIdx()) .tripDay(trip.getTripDay()) + .tripImg(trip.getTripImg()) .tripContent(trip.getTripContent()) .tripGoalAmount(trip.getTripGoalAmount()) .tripExpectedAmount(trip.getTripExpectedAmount()) From 9f98999727763e0d127025f1e1b5b21753621fee Mon Sep 17 00:00:00 2001 From: lcw729 Date: Fri, 7 Jun 2024 12:34:10 +0900 Subject: [PATCH 04/11] =?UTF-8?q?fix:=20=EC=97=AC=ED=96=89=20=EC=9D=BC?= =?UTF-8?q?=EC=A0=95=20=EC=98=88=EC=83=81=20=EB=B9=84=EC=9A=A9=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EA=B0=92=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hanaro/triptogether/trip/service/TripService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/hanaro/triptogether/trip/service/TripService.java b/src/main/java/com/hanaro/triptogether/trip/service/TripService.java index f99dcfb..231897a 100644 --- a/src/main/java/com/hanaro/triptogether/trip/service/TripService.java +++ b/src/main/java/com/hanaro/triptogether/trip/service/TripService.java @@ -75,6 +75,7 @@ public void createTrip(TripReqDto tripReqDto) throws NoSuchElementException{ .tripName(tripReqDto.getTripName()) .tripContent(tripReqDto.getTripContent()) .tripGoalAmount(tripReqDto.getTripGoalAmount()) + .tripExpectedAmount(BigDecimal.ZERO) .tripDay(tripReqDto.getTripDay()) .tripImg(tripReqDto.getTripImg()) .tripStartDay(tripReqDto.getTripStartDay()) From 6f04e2fd8549b10123281a6fe280fb12df5bdfa8 Mon Sep 17 00:00:00 2001 From: lcw729 Date: Fri, 7 Jun 2024 15:02:39 +0900 Subject: [PATCH 05/11] =?UTF-8?q?test:=20json=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=B6=9C=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 35fe08d..3a22d3c 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -46,6 +46,7 @@ jobs: echo "${{ secrets.PROPERTIES }}" > ./application.properties touch ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json echo "${{ secrets.FIREBASE_KEY }}" > ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json + cat ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json shell: bash - name: Grant execute permission to Gradle wrapper From c93073d8b2c51334b3d58971358d43bba4674949 Mon Sep 17 00:00:00 2001 From: ny2060 <48551119+ny2060@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:02:51 +0900 Subject: [PATCH 06/11] Update gradle.yml --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3a22d3c..3d9b225 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -47,6 +47,7 @@ jobs: touch ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json echo "${{ secrets.FIREBASE_KEY }}" > ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json cat ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json + pwd shell: bash - name: Grant execute permission to Gradle wrapper From 814ead027e3d59bcce5a7abf7d28a398c295c616 Mon Sep 17 00:00:00 2001 From: ny2060 <48551119+ny2060@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:18:42 +0900 Subject: [PATCH 07/11] Update gradle.yml --- .github/workflows/gradle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 3d9b225..6310385 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -48,6 +48,7 @@ jobs: echo "${{ secrets.FIREBASE_KEY }}" > ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json cat ./triptogether-e7bac-firebase-adminsdk-peiki-127517aa66.json pwd + ls shell: bash - name: Grant execute permission to Gradle wrapper From 93fdfa381c6e4f2c2b7bb8b677df282fa37ec216 Mon Sep 17 00:00:00 2001 From: lcw729 Date: Fri, 7 Jun 2024 16:29:32 +0900 Subject: [PATCH 08/11] =?UTF-8?q?fix:=20=EC=9D=BC=EC=A0=95=20=ED=95=98?= =?UTF-8?q?=EB=82=98=EC=9D=B8=20=EA=B2=BD=EC=9A=B0,=20=EC=82=AD=EC=A0=9C?= =?UTF-8?q?=20=EB=B6=88=EA=B0=80=20=EC=9D=B4=EC=8A=88=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../triptogether/tripPlace/service/TripPlaceService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java b/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java index 820472c..5b97dd2 100644 --- a/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java +++ b/src/main/java/com/hanaro/triptogether/tripPlace/service/TripPlaceService.java @@ -179,8 +179,11 @@ public void updateTripPlace(Long tripIdx, TripPlaceUpdateReqDto reqDto) { tripPlace.updateOrder(dto.getPlaceOrder(), dto.getTripDate(), member); } + BigDecimal expectedAmount = tripPlaceRepository.getSumPlaceAmountByTripIdx(tripIdx); + if (reqDto.getNewPlaces().isEmpty()) expectedAmount = BigDecimal.ZERO; + //goalAmount 계산 및 설정 - tripService.setExpectedAmount(tripIdx, tripPlaceRepository.getSumPlaceAmountByTripIdx(tripIdx)); + tripService.setExpectedAmount(tripIdx, expectedAmount); } From 0b11286814198de9091c70578a2aa642dd46b979 Mon Sep 17 00:00:00 2001 From: yubin-im Date: Mon, 10 Jun 2024 11:11:17 +0900 Subject: [PATCH 09/11] =?UTF-8?q?fix:=20=EB=AA=A8=EC=9E=84=EA=B0=80?= =?UTF-8?q?=EC=9E=85-=20=EA=B8=B0=EC=A1=B4=20=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/TeamMemberRepository.java | 3 +++ .../service/impl/TeamMemberServiceImpl.java | 21 ++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java b/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java index 51f7a71..6a03097 100644 --- a/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java +++ b/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java @@ -1,5 +1,6 @@ package com.hanaro.triptogether.teamMember.domain; +import com.hanaro.triptogether.member.domain.Member; import com.hanaro.triptogether.team.domain.Team; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; @@ -18,4 +19,6 @@ public interface TeamMemberRepository extends JpaRepository { List findTeamMemberByMember_MemberIdx(Long memberIdx); Optional findTeamMemberByMember_MemberIdxAndTeam_TeamIdx(Long memberIdx, Long teamIdx); + + TeamMember findTeamMemberByMemberAndTeam(Member member, Team team); } diff --git a/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java b/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java index 52daa22..e2907de 100644 --- a/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java +++ b/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java @@ -193,13 +193,20 @@ public void joinTeamMember(JoinTeamMemberReq joinTeamMemberReq) { Member member = memberRepository.findById(joinTeamMemberReq.getMemberIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.MEMBER_NOT_FOUND)); Team team = teamRepository.findById(joinTeamMemberReq.getTeamIdx()).orElseThrow(() -> new ApiException(ExceptionEnum.TEAM_NOT_FOUND)); - TeamMember teamMember = TeamMember.builder() - .team(team) - .member(member) - .teamMemberState(TeamMemberState.수락대기) - .createdAt(LocalDateTime.now()).build(); - - teamMemberRepository.save(teamMember); + TeamMember existingTeamMember = teamMemberRepository.findTeamMemberByMemberAndTeam(member, team); + + if (existingTeamMember != null) { + existingTeamMember.updateTeamMemberState(TeamMemberState.수락대기); + teamMemberRepository.save(existingTeamMember); + } else { + TeamMember teamMember = TeamMember.builder() + .team(team) + .member(member) + .teamMemberState(TeamMemberState.수락대기) + .createdAt(LocalDateTime.now()) + .build(); + teamMemberRepository.save(teamMember); + } } @Override From fae8e0ff97f81de9796f1ac63a833edd571d5278 Mon Sep 17 00:00:00 2001 From: mummhy0811 Date: Mon, 10 Jun 2024 11:36:54 +0900 Subject: [PATCH 10/11] =?UTF-8?q?fix:=20=EB=AA=A8=EC=9E=84=EC=9B=90=20?= =?UTF-8?q?=EB=AA=85=EC=88=98=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 + .../hanaro/triptogether/team/service/impl/TeamServiceImpl.java | 2 ++ .../triptogether/teamMember/domain/TeamMemberRepository.java | 3 +++ 3 files changed, 6 insertions(+) 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 b192308..025cb53 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 @@ -15,4 +15,5 @@ public class DetailTeamResDto { private BigDecimal accBalance; private TeamMemberState teamMemberState; private Long preferTripIdx; + private Integer teamMemberCount; } 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 a1ae267..15505ff 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 @@ -68,6 +68,7 @@ public void addTeam(AddTeamReqDto addTeamReqDto) { 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)); + Integer teamMemberCount = teamMemberRepository.findTeamMembersByTeamAndTeamMemberState(team); Long preferTripIdx = null; if(team.getPreferTrip()!=null) preferTripIdx = team.getPreferTrip().getTripIdx(); @@ -78,6 +79,7 @@ public DetailTeamResDto detailTeam(DetailTeamReqDto detailTeamReqDto) { .accNumber(team.getAccount().getAccNumber()) .accBalance(team.getAccount().getAccBalance()) .teamMemberState(teamMember.getTeamMemberState()) + .teamMemberCount(teamMemberCount) .build(); } diff --git a/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java b/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java index 51f7a71..eccf41d 100644 --- a/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java +++ b/src/main/java/com/hanaro/triptogether/teamMember/domain/TeamMemberRepository.java @@ -18,4 +18,7 @@ public interface TeamMemberRepository extends JpaRepository { List findTeamMemberByMember_MemberIdx(Long memberIdx); Optional findTeamMemberByMember_MemberIdxAndTeam_TeamIdx(Long memberIdx, Long teamIdx); + + @Query("SELECT count(*) FROM TeamMember tm where tm.team = :team and deletedAt is null and (tm.teamMemberState=\"총무\" or tm.teamMemberState=\"모임원\")") + Integer findTeamMembersByTeamAndTeamMemberState(Team team); } From aafbaeb8163688397a47e53622f0b7881953a880 Mon Sep 17 00:00:00 2001 From: yubin-im Date: Mon, 10 Jun 2024 13:25:33 +0900 Subject: [PATCH 11/11] =?UTF-8?q?fix:=20=EB=AA=A8=EC=9E=84=EA=B0=80?= =?UTF-8?q?=EC=9E=85-=20=EA=B8=B0=EC=A1=B4=20=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91=20=EA=B8=B0=EB=8A=A5=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../teamMember/service/impl/TeamMemberServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java b/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java index e2907de..bc7ecbd 100644 --- a/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java +++ b/src/main/java/com/hanaro/triptogether/teamMember/service/impl/TeamMemberServiceImpl.java @@ -197,6 +197,7 @@ public void joinTeamMember(JoinTeamMemberReq joinTeamMemberReq) { if (existingTeamMember != null) { existingTeamMember.updateTeamMemberState(TeamMemberState.수락대기); + existingTeamMember.delete(null, null); teamMemberRepository.save(existingTeamMember); } else { TeamMember teamMember = TeamMember.builder()