From 194d98e21d75ef3e8f9a19d211a9cf70996d2891 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Sat, 1 Jun 2024 17:12:22 +0900 Subject: [PATCH 1/8] =?UTF-8?q?feat=20:=20=EA=B8=B0=EC=A1=B4=20API=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=EB=AA=85=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EB=B0=8F=20=EC=BF=BC=EB=A6=AC=20=EC=88=98=EC=A0=95,=20?= =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20=EC=B4=88=EB=8C=80=20=EB=B3=B4=EB=82=B8=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20API=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 기존 API 메서드명 통일성을 위해 변경 - 기존 API 쿼리에 where 절에 조건 없어서 추가 - 그룹 초대 보낸 목록 조회 API 추가 --- .gitignore | 2 +- .../api/query/MemberGroupQueryApi.java | 33 +++++++++++-- .../query/MemberGroupQueryApiController.java | 44 +++++++++++++++--- .../data/dto/GroupInviteSummaryDto.java | 6 +-- .../data/dto/GroupSendingInviteMemberDto.java | 22 +++++++++ .../dto/GroupSendingInvitesRequestDto.java | 20 ++++++++ ... GroupReceptionInviteSummaryResponse.java} | 4 +- ...> GroupReceptionInvitesSliceResponse.java} | 11 +++-- .../GroupSendingInviteMemberResponse.java | 19 ++++++++ .../GroupSendingInvitesSliceResponse.java | 26 +++++++++++ .../GroupInviteQueryRepository.java | 6 ++- .../GroupInviteQueryRepositoryImpl.java | 46 ++++++++++++++++--- .../service/MemberGroupQueryService.java | 11 ++++- .../GroupInviteQueryRepositoryTest.java | 6 +-- 14 files changed, 221 insertions(+), 35 deletions(-) create mode 100644 backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInviteMemberDto.java create mode 100644 backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInvitesRequestDto.java rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/{GroupInviteSummaryResponse.java => GroupReceptionInviteSummaryResponse.java} (89%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/{GroupInviteSummaryResponses.java => GroupReceptionInvitesSliceResponse.java} (62%) create mode 100644 backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInviteMemberResponse.java create mode 100644 backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java diff --git a/.gitignore b/.gitignore index 91cd78597..51e94bb56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ .idea -data \ No newline at end of file +backend/data \ No newline at end of file diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java index 18e84fcf6..38edc4c66 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java @@ -8,15 +8,16 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import java.time.ZonedDateTime; import org.springframework.http.ResponseEntity; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupInviteSummaryResponses; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInvitesSliceResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesSliceResponse; import site.timecapsulearchive.core.global.common.response.ApiSpec; public interface MemberGroupQueryApi { @Operation( - summary = "그룹 요청 목록 조회", - description = "사용자애게 그룹 초대 요청이 온 그룹 목록을 조회한다.", + summary = "그룹 요청 받은 목록 조회", + description = "사용자에게 그룹 초대 요청이 온 모든 그룹 목록을 조회한다.", security = {@SecurityRequirement(name = "user_token")}, tags = {"member group"} ) @@ -26,7 +27,7 @@ public interface MemberGroupQueryApi { description = "ok" ) }) - ResponseEntity> findGroupInvites( + ResponseEntity> findGroupReceptionInvites( Long memberId, @Parameter(in = ParameterIn.QUERY, description = "페이지 크기", required = true) @@ -36,4 +37,28 @@ ResponseEntity> findGroupInvites( ZonedDateTime createdAt ); + @Operation( + summary = "그룹 요청 보낸 목록 조회", + description = "그룹장이 그룹 별로 그룹 초대 요청을 보낸 사용자 목록을 조회한다.", + security = {@SecurityRequirement(name = "user_token")}, + tags = {"member group"} + ) + @ApiResponses(value = { + @ApiResponse( + responseCode = "200", + description = "ok" + ) + }) + ResponseEntity> findGroupSendingInvites( + Long memberId, + + @Parameter(in = ParameterIn.PATH, description = "그룹 아이디", required = true) + Long groupId, + + @Parameter(in = ParameterIn.QUERY, description = "페이지 크기", required = true) + int size, + + @Parameter(in = ParameterIn.QUERY, description = "마지막 데이터의 시간", required = true) + ZonedDateTime createdAt + ); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java index bbdbe2a36..72f18e470 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java @@ -6,11 +6,15 @@ import org.springframework.http.ResponseEntity; import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupInviteSummaryResponses; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInvitesSliceResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesSliceResponse; import site.timecapsulearchive.core.domain.member_group.service.MemberGroupQueryService; import site.timecapsulearchive.core.global.common.response.ApiSpec; import site.timecapsulearchive.core.global.common.response.SuccessCode; @@ -26,28 +30,54 @@ public class MemberGroupQueryApiController implements MemberGroupQueryApi { @GetMapping( - value = "/invites", + value = "/reception-invites", produces = {"application/json"} ) @Override - public ResponseEntity> findGroupInvites( + public ResponseEntity> findGroupReceptionInvites( @AuthenticationPrincipal final Long memberId, @RequestParam(defaultValue = "20", value = "size") final int size, @RequestParam(value = "created_at") final ZonedDateTime createdAt ) { - final Slice groupInviteSummaryDtos = memberGroupQueryService.findGroupInvites( + final Slice groupInviteSummarySlice = memberGroupQueryService.findGroupReceptionInvitesSlice( memberId, size, createdAt); return ResponseEntity.ok( ApiSpec.success( SuccessCode.SUCCESS, - GroupInviteSummaryResponses.createOf( - groupInviteSummaryDtos.getContent(), - groupInviteSummaryDtos.hasNext(), + GroupReceptionInvitesSliceResponse.createOf( + groupInviteSummarySlice.getContent(), + groupInviteSummarySlice.hasNext(), s3PreSignedUrlManager::getS3PreSignedUrlForGet ) ) ); } + @GetMapping( + value = "/{group_id}/sending-invites", + produces = {"application/json"} + ) + @Override + public ResponseEntity> findGroupSendingInvites( + @AuthenticationPrincipal final Long memberId, + @PathVariable(value = "group_id") final Long groupId, + @RequestParam(defaultValue = "20", value = "size") final int size, + @RequestParam(value = "created_at") final ZonedDateTime createdAt + ) { + GroupSendingInvitesRequestDto dto = GroupSendingInvitesRequestDto.create( + memberId, groupId, size, createdAt); + Slice groupSendingInvitesSlice = memberGroupQueryService.findGroupSendingInvites( + dto); + + return ResponseEntity.ok( + ApiSpec.success( + SuccessCode.SUCCESS, + GroupSendingInvitesSliceResponse.createOf( + groupSendingInvitesSlice.getContent(), + groupSendingInvitesSlice.hasNext() + ) + ) + ); + } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java index 140f58ec7..8c4c7fe55 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java @@ -3,7 +3,7 @@ import java.time.ZonedDateTime; import java.util.function.Function; import lombok.Builder; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupInviteSummaryResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInviteSummaryResponse; @Builder public record GroupInviteSummaryDto( @@ -16,10 +16,10 @@ public record GroupInviteSummaryDto( String groupOwnerName ) { - public GroupInviteSummaryResponse toResponse( + public GroupReceptionInviteSummaryResponse toResponse( final Function preSignedUrlFunction ) { - return GroupInviteSummaryResponse.builder() + return GroupReceptionInviteSummaryResponse.builder() .groupId(groupId) .groupName(groupName) .groupProfileUrl(preSignedUrlFunction.apply(groupProfileUrl)) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInviteMemberDto.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInviteMemberDto.java new file mode 100644 index 000000000..2fcb0f82b --- /dev/null +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInviteMemberDto.java @@ -0,0 +1,22 @@ +package site.timecapsulearchive.core.domain.member_group.data.dto; + + +import java.time.ZonedDateTime; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInviteMemberResponse; + +public record GroupSendingInviteMemberDto( + Long id, + String nickname, + String profileUrl, + ZonedDateTime sendingInvitesCreatedAt +) { + + public GroupSendingInviteMemberResponse toResponse() { + return GroupSendingInviteMemberResponse.builder() + .id(id) + .nickname(nickname) + .profileUrl(profileUrl) + .sendingInvitesCreatedAt(sendingInvitesCreatedAt) + .build(); + } +} diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInvitesRequestDto.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInvitesRequestDto.java new file mode 100644 index 000000000..73138d8d5 --- /dev/null +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInvitesRequestDto.java @@ -0,0 +1,20 @@ +package site.timecapsulearchive.core.domain.member_group.data.dto; + +import java.time.ZonedDateTime; + +public record GroupSendingInvitesRequestDto( + Long memberId, + Long groupId, + int size, + ZonedDateTime createdAt +) { + + public static GroupSendingInvitesRequestDto create( + final Long memberId, + final Long groupId, + final int size, + final ZonedDateTime createdAt + ) { + return new GroupSendingInvitesRequestDto(memberId, groupId, size, createdAt); + } +} diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupInviteSummaryResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java similarity index 89% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupInviteSummaryResponse.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java index 77acf1acf..dffd6d1b5 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupInviteSummaryResponse.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java @@ -7,7 +7,7 @@ @Builder @Schema(description = "초대온 그룹 요약 정보") -public record GroupInviteSummaryResponse( +public record GroupReceptionInviteSummaryResponse( @Schema(description = "그룹 아이디") Long groupId, @@ -28,7 +28,7 @@ public record GroupInviteSummaryResponse( String groupOwnerName ) { - public GroupInviteSummaryResponse { + public GroupReceptionInviteSummaryResponse { if (createdAt != null) { createdAt = createdAt.withZoneSameInstant(ResponseMappingConstant.ZONE_ID); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupInviteSummaryResponses.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInvitesSliceResponse.java similarity index 62% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupInviteSummaryResponses.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInvitesSliceResponse.java index 4dd508058..95e5acdd8 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupInviteSummaryResponses.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInvitesSliceResponse.java @@ -5,22 +5,23 @@ import java.util.function.Function; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; -public record GroupInviteSummaryResponses( +public record GroupReceptionInvitesSliceResponse( @Schema(description = "초대 온 그룹 요약 정보 리스트") - List responses, + List responses, @Schema(description = "다음 페이지 유무") Boolean hasNext ) { - public static GroupInviteSummaryResponses createOf( + public static GroupReceptionInvitesSliceResponse createOf( final List dtos, final boolean hasNext, final Function preSignedUrlFunction ) { - List groupInviteSummaryResponses = dtos.stream() + List groupReceptionInviteSummaryResponses = dtos.stream() .map(dto -> dto.toResponse(preSignedUrlFunction)).toList(); - return new GroupInviteSummaryResponses(groupInviteSummaryResponses, hasNext); + return new GroupReceptionInvitesSliceResponse(groupReceptionInviteSummaryResponses, + hasNext); } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInviteMemberResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInviteMemberResponse.java new file mode 100644 index 000000000..b4193f30f --- /dev/null +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInviteMemberResponse.java @@ -0,0 +1,19 @@ +package site.timecapsulearchive.core.domain.member_group.data.response; + +import java.time.ZonedDateTime; +import lombok.Builder; +import site.timecapsulearchive.core.global.common.response.ResponseMappingConstant; + +@Builder +public record GroupSendingInviteMemberResponse( + Long id, + String nickname, + String profileUrl, + ZonedDateTime sendingInvitesCreatedAt +) { + public GroupSendingInviteMemberResponse { + if (sendingInvitesCreatedAt != null) { + sendingInvitesCreatedAt = sendingInvitesCreatedAt.withZoneSameInstant(ResponseMappingConstant.ZONE_ID); + } + } +} diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java new file mode 100644 index 000000000..c584e87a3 --- /dev/null +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java @@ -0,0 +1,26 @@ +package site.timecapsulearchive.core.domain.member_group.data.response; + +import io.swagger.v3.oas.annotations.media.Schema; +import java.util.List; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; + +@Schema(description = "그룹 초대 보낸 목록") +public record GroupSendingInvitesSliceResponse( + @Schema(description = "초대 보낸 그룹원 정보 리스트") + List responses, + + @Schema(description = "다음 페이지 유무") + Boolean hasNext +) { + + public static GroupSendingInvitesSliceResponse createOf( + final List groupSendingInviteMemberDtos, + final boolean hasNext + ) { + List groupSendingInviteMemberResponses = groupSendingInviteMemberDtos.stream() + .map(GroupSendingInviteMemberDto::toResponse) + .toList(); + + return new GroupSendingInvitesSliceResponse(groupSendingInviteMemberResponses, hasNext); + } +} diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java index 7d1725f84..8a5ea2991 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java @@ -4,6 +4,8 @@ import java.util.List; import org.springframework.data.domain.Slice; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; public interface GroupInviteQueryRepository { @@ -11,9 +13,11 @@ public interface GroupInviteQueryRepository { List findGroupInviteIdsByGroupIdAndGroupOwnerId(final Long groupId, final Long memberId); - Slice findGroupInvitesSummary( + Slice findGroupRecetpionInvitesSlice( final Long memberId, final int size, final ZonedDateTime createdAt ); + + Slice findGroupSendingInvitesSlice(GroupSendingInvitesRequestDto dto); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java index 2936216ef..ba90e69cb 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java @@ -21,6 +21,8 @@ import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Repository; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; @Repository @RequiredArgsConstructor @@ -71,7 +73,7 @@ public List findGroupInviteIdsByGroupIdAndGroupOwnerId( } @Override - public Slice findGroupInvitesSummary( + public Slice findGroupRecetpionInvitesSlice( final Long memberId, final int size, final ZonedDateTime createdAt @@ -87,21 +89,51 @@ public Slice findGroupInvitesSummary( group.createdAt, member.nickname ) - ) .from(groupInvite) .join(groupInvite.group, group) - .join(groupInvite.groupOwner, member).on(groupInvite.groupMember.id.eq(memberId)) - .where(groupInvite.createdAt.lt(createdAt)) + .join(groupInvite.groupOwner, member) + .where(groupInvite.groupMember.id.eq(memberId).and(groupInvite.createdAt.lt(createdAt))) .limit(size + 1) .fetch(); - final boolean hasNext = groupInviteSummaryDtos.size() > size; + return makeSlice(size, groupInviteSummaryDtos); + } + + private Slice makeSlice( + final int size, + final List dtos + ) { + final boolean hasNext = dtos.size() > size; if (hasNext) { - groupInviteSummaryDtos.remove(size); + dtos.remove(size); } - return new SliceImpl<>(groupInviteSummaryDtos, Pageable.ofSize(size), hasNext); + return new SliceImpl<>(dtos, Pageable.ofSize(size), hasNext); } + @Override + public Slice findGroupSendingInvitesSlice( + final GroupSendingInvitesRequestDto dto + ) { + final List groupSendingInviteMemberDtos = jpaQueryFactory + .select( + Projections.constructor( + GroupSendingInviteMemberDto.class, + member.id, + member.nickname, + member.profileUrl, + groupInvite.createdAt + ) + ) + .from(groupInvite) + .join(groupInvite.groupMember, member) + .where(groupInvite.group.id.eq(dto.groupId()) + .and(groupInvite.groupOwner.id.eq(dto.memberId())) + .and(groupInvite.createdAt.loe(dto.createdAt()))) + .limit(dto.size() + 1) + .fetch(); + + return makeSlice(dto.size(), groupSendingInviteMemberDtos); + } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java index 0bf45099e..a6734bbea 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java @@ -6,6 +6,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; @Service @@ -15,12 +17,17 @@ public class MemberGroupQueryService { private final GroupInviteRepository groupInviteRepository; - public Slice findGroupInvites( + public Slice findGroupReceptionInvitesSlice( final Long memberId, final int size, final ZonedDateTime createdAt ) { - return groupInviteRepository.findGroupInvitesSummary(memberId, size, createdAt); + return groupInviteRepository.findGroupRecetpionInvitesSlice(memberId, size, createdAt); } + public Slice findGroupSendingInvites( + final GroupSendingInvitesRequestDto dto + ) { + return groupInviteRepository.findGroupSendingInvitesSlice(dto); + } } diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java index 52048ddda..d2fec9d12 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java @@ -72,7 +72,7 @@ void setUp(@Autowired EntityManager entityManager) { ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); //when - Slice groupInvitesSummary = groupInviteRepository.findGroupInvitesSummary( + Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( memberId, size, createAt); //then @@ -87,7 +87,7 @@ void setUp(@Autowired EntityManager entityManager) { ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); //when - Slice groupInvitesSummary = groupInviteRepository.findGroupInvitesSummary( + Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( memberId, size, createAt); //then @@ -108,7 +108,7 @@ void setUp(@Autowired EntityManager entityManager) { ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); //when - Slice groupInvitesSummary = groupInviteRepository.findGroupInvitesSummary( + Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( memberId, size, createAt); //then From aaad884b391a16d3cfcb764f10995941a897eb88 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Sat, 1 Jun 2024 17:25:37 +0900 Subject: [PATCH 2/8] =?UTF-8?q?fix=20:=20=EC=B4=88=EB=8C=80=ED=95=9C=20?= =?UTF-8?q?=EA=B7=B8=EB=A3=B9=EC=9B=90=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0?= =?UTF-8?q?=ED=9A=8C=20=EC=8A=A4=ED=8E=99=20=EB=B3=80=EA=B2=BD,=20?= =?UTF-8?q?=ED=8C=A8=ED=82=A4=EC=A7=80=20=EC=9D=B4=EB=A6=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 현재 그룹원 포함 최대 30명까지 초대 가능하므로 슬라이스 대신 리스트로 변경 - 패키지 이름 변경 --- .../service/command/GroupCommandService.java | 4 ++-- .../api/query/MemberGroupQueryApi.java | 14 ++++--------- .../query/MemberGroupQueryApiController.java | 21 +++++++------------ ....java => GroupSendingInvitesResponse.java} | 15 ++++++------- .../GroupInviteQueryRepository.java | 8 ++++--- .../GroupInviteQueryRepositoryImpl.java | 18 +++++++--------- .../GroupInviteRepository.java | 2 +- .../MemberGroupQueryRepository.java | 2 +- .../MemberGroupQueryRepositoryImpl.java | 2 +- .../MemberGroupRepository.java | 2 +- .../service/MemberGroupCommandService.java | 4 ++-- .../service/MemberGroupQueryService.java | 11 +++++----- .../service/GroupCommandServiceTest.java | 4 ++-- .../MemberGroupQueryRepositoryTest.java | 8 +++---- .../MemberGroupCommandServiceTest.java | 4 ++-- 15 files changed, 51 insertions(+), 68 deletions(-) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/{GroupSendingInvitesSliceResponse.java => GroupSendingInvitesResponse.java} (63%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/{groupInviteRepository => group_invite_repository}/GroupInviteQueryRepository.java (77%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/{groupInviteRepository => group_invite_repository}/GroupInviteQueryRepositoryImpl.java (87%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/{groupInviteRepository => group_invite_repository}/GroupInviteRepository.java (96%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/{memberGroupRepository => member_group_repository}/MemberGroupQueryRepository.java (93%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/{memberGroupRepository => member_group_repository}/MemberGroupQueryRepositoryImpl.java (98%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/{memberGroupRepository => member_group_repository}/MemberGroupRepository.java (95%) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/group/service/command/GroupCommandService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/group/service/command/GroupCommandService.java index c15b73e01..0b7d4d9ce 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/group/service/command/GroupCommandService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/group/service/command/GroupCommandService.java @@ -20,8 +20,8 @@ import site.timecapsulearchive.core.domain.member_group.entity.MemberGroup; import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.exception.NoGroupAuthorityException; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; import site.timecapsulearchive.core.global.error.ErrorCode; import site.timecapsulearchive.core.infra.queue.manager.SocialNotificationManager; import site.timecapsulearchive.core.infra.s3.manager.S3ObjectManager; diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java index 38edc4c66..b3fc268bd 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java @@ -9,7 +9,7 @@ import java.time.ZonedDateTime; import org.springframework.http.ResponseEntity; import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInvitesSliceResponse; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesSliceResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesResponse; import site.timecapsulearchive.core.global.common.response.ApiSpec; public interface MemberGroupQueryApi { @@ -39,7 +39,7 @@ ResponseEntity> findGroupReceptionIn @Operation( summary = "그룹 요청 보낸 목록 조회", - description = "그룹장이 그룹 별로 그룹 초대 요청을 보낸 사용자 목록을 조회한다.", + description = "그룹장이 그룹 별로 그룹 초대 요청을 보낸 사용자 목록을 조회한다. 최대 30개가 반환된다.", security = {@SecurityRequirement(name = "user_token")}, tags = {"member group"} ) @@ -49,16 +49,10 @@ ResponseEntity> findGroupReceptionIn description = "ok" ) }) - ResponseEntity> findGroupSendingInvites( + ResponseEntity> findGroupSendingInvites( Long memberId, @Parameter(in = ParameterIn.PATH, description = "그룹 아이디", required = true) - Long groupId, - - @Parameter(in = ParameterIn.QUERY, description = "페이지 크기", required = true) - int size, - - @Parameter(in = ParameterIn.QUERY, description = "마지막 데이터의 시간", required = true) - ZonedDateTime createdAt + Long groupId ); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java index 72f18e470..0685b9703 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java @@ -1,6 +1,7 @@ package site.timecapsulearchive.core.domain.member_group.api.query; import java.time.ZonedDateTime; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Slice; import org.springframework.http.ResponseEntity; @@ -12,9 +13,8 @@ import org.springframework.web.bind.annotation.RestController; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; -import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInvitesSliceResponse; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesSliceResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesResponse; import site.timecapsulearchive.core.domain.member_group.service.MemberGroupQueryService; import site.timecapsulearchive.core.global.common.response.ApiSpec; import site.timecapsulearchive.core.global.common.response.SuccessCode; @@ -59,24 +59,17 @@ public ResponseEntity> findGroupRece produces = {"application/json"} ) @Override - public ResponseEntity> findGroupSendingInvites( + public ResponseEntity> findGroupSendingInvites( @AuthenticationPrincipal final Long memberId, - @PathVariable(value = "group_id") final Long groupId, - @RequestParam(defaultValue = "20", value = "size") final int size, - @RequestParam(value = "created_at") final ZonedDateTime createdAt + @PathVariable(value = "group_id") final Long groupId ) { - GroupSendingInvitesRequestDto dto = GroupSendingInvitesRequestDto.create( - memberId, groupId, size, createdAt); - Slice groupSendingInvitesSlice = memberGroupQueryService.findGroupSendingInvites( - dto); + List groupSendingInvites = memberGroupQueryService.findGroupSendingInvites( + memberId, groupId); return ResponseEntity.ok( ApiSpec.success( SuccessCode.SUCCESS, - GroupSendingInvitesSliceResponse.createOf( - groupSendingInvitesSlice.getContent(), - groupSendingInvitesSlice.hasNext() - ) + GroupSendingInvitesResponse.createOf(groupSendingInvites) ) ); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesResponse.java similarity index 63% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesResponse.java index c584e87a3..4be590970 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesSliceResponse.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesResponse.java @@ -5,22 +5,19 @@ import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; @Schema(description = "그룹 초대 보낸 목록") -public record GroupSendingInvitesSliceResponse( - @Schema(description = "초대 보낸 그룹원 정보 리스트") - List responses, +public record GroupSendingInvitesResponse( - @Schema(description = "다음 페이지 유무") - Boolean hasNext + @Schema(description = "초대 보낸 그룹원 정보 리스트") + List responses ) { - public static GroupSendingInvitesSliceResponse createOf( - final List groupSendingInviteMemberDtos, - final boolean hasNext + public static GroupSendingInvitesResponse createOf( + final List groupSendingInviteMemberDtos ) { List groupSendingInviteMemberResponses = groupSendingInviteMemberDtos.stream() .map(GroupSendingInviteMemberDto::toResponse) .toList(); - return new GroupSendingInvitesSliceResponse(groupSendingInviteMemberResponses, hasNext); + return new GroupSendingInvitesResponse(groupSendingInviteMemberResponses); } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java similarity index 77% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java index 8a5ea2991..899883909 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java @@ -1,11 +1,10 @@ -package site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository; +package site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository; import java.time.ZonedDateTime; import java.util.List; import org.springframework.data.domain.Slice; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; -import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; public interface GroupInviteQueryRepository { @@ -19,5 +18,8 @@ Slice findGroupRecetpionInvitesSlice( final ZonedDateTime createdAt ); - Slice findGroupSendingInvitesSlice(GroupSendingInvitesRequestDto dto); + List findGroupSendingInvites( + final Long memberId, + final Long groupId + ); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java similarity index 87% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java index ba90e69cb..c76739b55 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java @@ -1,4 +1,4 @@ -package site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository; +package site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository; import static site.timecapsulearchive.core.domain.group.entity.QGroup.group; @@ -22,7 +22,6 @@ import org.springframework.stereotype.Repository; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; -import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; @Repository @RequiredArgsConstructor @@ -113,10 +112,11 @@ private Slice makeSlice( } @Override - public Slice findGroupSendingInvitesSlice( - final GroupSendingInvitesRequestDto dto + public List findGroupSendingInvites( + final Long memberId, + final Long groupId ) { - final List groupSendingInviteMemberDtos = jpaQueryFactory + return jpaQueryFactory .select( Projections.constructor( GroupSendingInviteMemberDto.class, @@ -128,12 +128,8 @@ public Slice findGroupSendingInvitesSlice( ) .from(groupInvite) .join(groupInvite.groupMember, member) - .where(groupInvite.group.id.eq(dto.groupId()) - .and(groupInvite.groupOwner.id.eq(dto.memberId())) - .and(groupInvite.createdAt.loe(dto.createdAt()))) - .limit(dto.size() + 1) + .where(groupInvite.group.id.eq(groupId) + .and(groupInvite.groupOwner.id.eq(memberId))) .fetch(); - - return makeSlice(dto.size(), groupSendingInviteMemberDtos); } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteRepository.java similarity index 96% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteRepository.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteRepository.java index e429c0346..51b5f37e7 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/groupInviteRepository/GroupInviteRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteRepository.java @@ -1,4 +1,4 @@ -package site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository; +package site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository; import java.util.List; import org.springframework.data.jpa.repository.Modifying; diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupQueryRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupQueryRepository.java similarity index 93% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupQueryRepository.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupQueryRepository.java index 963047020..8cf25fa5a 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupQueryRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupQueryRepository.java @@ -1,4 +1,4 @@ -package site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository; +package site.timecapsulearchive.core.domain.member_group.repository.member_group_repository; import java.util.Optional; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupOwnerSummaryDto; diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupQueryRepositoryImpl.java similarity index 98% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupQueryRepositoryImpl.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupQueryRepositoryImpl.java index 8aa557ac2..e0b22628d 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupQueryRepositoryImpl.java @@ -1,4 +1,4 @@ -package site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository; +package site.timecapsulearchive.core.domain.member_group.repository.member_group_repository; import static site.timecapsulearchive.core.domain.group.entity.QGroup.group; import static site.timecapsulearchive.core.domain.member.entity.QMember.member; diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupRepository.java similarity index 95% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupRepository.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupRepository.java index 2d42643b7..6f2a9cf28 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/memberGroupRepository/MemberGroupRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/member_group_repository/MemberGroupRepository.java @@ -1,4 +1,4 @@ -package site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository; +package site.timecapsulearchive.core.domain.member_group.repository.member_group_repository; import java.util.List; import java.util.Optional; diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java index 7596c951d..077ff4666 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java @@ -21,8 +21,8 @@ import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupKickDuplicatedIdException; import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.exception.NoGroupAuthorityException; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; import site.timecapsulearchive.core.infra.queue.manager.SocialNotificationManager; @Service diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java index a6734bbea..90b888beb 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java @@ -1,14 +1,14 @@ package site.timecapsulearchive.core.domain.member_group.service; import java.time.ZonedDateTime; +import java.util.List; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Slice; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; -import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInvitesRequestDto; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; @Service @RequiredArgsConstructor @@ -25,9 +25,10 @@ public Slice findGroupReceptionInvitesSlice( return groupInviteRepository.findGroupRecetpionInvitesSlice(memberId, size, createdAt); } - public Slice findGroupSendingInvites( - final GroupSendingInvitesRequestDto dto + public List findGroupSendingInvites( + final Long memberId, + final Long groupId ) { - return groupInviteRepository.findGroupSendingInvitesSlice(dto); + return groupInviteRepository.findGroupSendingInvites(memberId, groupId); } } diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupCommandServiceTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupCommandServiceTest.java index f6b55a63f..248433597 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupCommandServiceTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/group/service/GroupCommandServiceTest.java @@ -34,8 +34,8 @@ import site.timecapsulearchive.core.domain.member_group.entity.MemberGroup; import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.exception.NoGroupAuthorityException; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; import site.timecapsulearchive.core.global.error.ErrorCode; import site.timecapsulearchive.core.infra.queue.manager.SocialNotificationManager; import site.timecapsulearchive.core.infra.s3.manager.S3ObjectManager; diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/MemberGroupQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/MemberGroupQueryRepositoryTest.java index c0a2329ef..a9709d0bc 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/MemberGroupQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/MemberGroupQueryRepositoryTest.java @@ -66,10 +66,6 @@ void setup(@Autowired EntityManager entityManager) { groups.add(group); } - //그룹원들 - List members = MemberFixture.members(4, 2); - members.forEach(entityManager::persist); - //그룹에 사용자를 그룹장으로 설정 for (int count = 0; count < GROUP_COUNT; count++) { MemberGroup memberGroup = MemberGroupFixture.memberGroup(member, groups.get(count), @@ -77,6 +73,10 @@ void setup(@Autowired EntityManager entityManager) { entityManager.persist(memberGroup); } + //그룹원들 + List members = MemberFixture.members(4, 2); + members.forEach(entityManager::persist); + //그룹원들 설정 List memberGroups = MemberGroupFixture.memberGroups(members, groups.get(0)); memberGroups.forEach(entityManager::persist); diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java index 58cfe0eee..2ea2586ee 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java @@ -34,8 +34,8 @@ import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.exception.GroupMemberCountLimitException; import site.timecapsulearchive.core.domain.member_group.exception.NoGroupAuthorityException; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; import site.timecapsulearchive.core.global.error.ErrorCode; import site.timecapsulearchive.core.infra.queue.manager.SocialNotificationManager; From e0a3ee00fa56351866e7011873fe8c1ba1fb18b5 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Sat, 1 Jun 2024 18:02:26 +0900 Subject: [PATCH 3/8] =?UTF-8?q?fix=20:=20=EA=B7=B8=EB=A3=B9=20=EC=B4=88?= =?UTF-8?q?=EB=8C=80=20=EB=B3=B4=EB=82=B8=20=EC=8B=9C=EA=B0=84=EC=9C=BC?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20&=20=EC=BF=BC=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../member_group/data/dto/GroupInviteSummaryDto.java | 4 ++-- .../response/GroupReceptionInviteSummaryResponse.java | 9 +++++---- .../GroupInviteQueryRepositoryImpl.java | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java index 8c4c7fe55..3d3ec6570 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java @@ -12,7 +12,7 @@ public record GroupInviteSummaryDto( String groupName, String groupProfileUrl, String description, - ZonedDateTime createdAt, + ZonedDateTime groupReceptionInviteTime, String groupOwnerName ) { @@ -24,7 +24,7 @@ public GroupReceptionInviteSummaryResponse toResponse( .groupName(groupName) .groupProfileUrl(preSignedUrlFunction.apply(groupProfileUrl)) .description(description) - .createdAt(createdAt) + .groupReceptionInviteTime(groupReceptionInviteTime) .groupOwnerName(groupOwnerName) .build(); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java index dffd6d1b5..dff6de490 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java @@ -21,16 +21,17 @@ public record GroupReceptionInviteSummaryResponse( @Schema(description = "그룹 설명") String description, - @Schema(description = "그룹 생성일") - ZonedDateTime createdAt, + @Schema(description = "그룹 초대 시간") + ZonedDateTime groupReceptionInviteTime, @Schema(description = "그룹장") String groupOwnerName ) { public GroupReceptionInviteSummaryResponse { - if (createdAt != null) { - createdAt = createdAt.withZoneSameInstant(ResponseMappingConstant.ZONE_ID); + if (groupReceptionInviteTime != null) { + groupReceptionInviteTime = groupReceptionInviteTime.withZoneSameInstant( + ResponseMappingConstant.ZONE_ID); } } } \ No newline at end of file diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java index c76739b55..c7b115a58 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java @@ -85,14 +85,14 @@ public Slice findGroupRecetpionInvitesSlice( group.groupName, group.groupProfileUrl, group.groupDescription, - group.createdAt, + groupInvite.createdAt, member.nickname ) ) .from(groupInvite) .join(groupInvite.group, group) .join(groupInvite.groupOwner, member) - .where(groupInvite.groupMember.id.eq(memberId).and(groupInvite.createdAt.lt(createdAt))) + .where(groupInvite.groupMember.id.eq(memberId).and(groupInvite.createdAt.loe(createdAt))) .limit(size + 1) .fetch(); From 4f6a860695e612d716d62cae54380e664bcc23c7 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Sat, 1 Jun 2024 18:04:28 +0900 Subject: [PATCH 4/8] =?UTF-8?q?test=20:=20=EA=B8=B0=EC=A1=B4=20API,=20?= =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20=EB=AA=A9=EB=A1=9D=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GroupInviteQueryRepositoryTest.java | 78 ++++++++++++++----- 1 file changed, 59 insertions(+), 19 deletions(-) diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java index d2fec9d12..1aad3c7de 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java @@ -1,12 +1,12 @@ package site.timecapsulearchive.core.domain.member_group.repository; -import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.assertj.core.api.Assertions.assertThat; import com.querydsl.jpa.impl.JPAQueryFactory; import jakarta.persistence.EntityManager; +import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.List; -import org.assertj.core.api.Assertions; import org.assertj.core.api.SoftAssertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -22,16 +22,21 @@ import site.timecapsulearchive.core.domain.group.entity.Group; import site.timecapsulearchive.core.domain.member.entity.Member; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; +import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; import site.timecapsulearchive.core.domain.member_group.entity.GroupInvite; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteQueryRepository; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteQueryRepositoryImpl; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteQueryRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteQueryRepositoryImpl; @TestConstructor(autowireMode = AutowireMode.ALL) class GroupInviteQueryRepositoryTest extends RepositoryTest { private static final int MAX_GROUP_COUNT = 2; + private final GroupInviteQueryRepository groupInviteRepository; - private Member groupMember; + + private Long groupId; + private Long groupOwnerId; + private Long groupMemberId; GroupInviteQueryRepositoryTest( JdbcTemplate jdbcTemplate, @@ -47,14 +52,17 @@ void setUp(@Autowired EntityManager entityManager) { // 그룹 초대 할 그룹장들 List groupOwners = MemberFixture.members(0, MAX_GROUP_COUNT); groupOwners.forEach(entityManager::persist); + groupOwnerId = groupOwners.get(0).getId(); //그룹 초대 올 그룹원 - groupMember = MemberFixture.member(2); + Member groupMember = MemberFixture.member(2); entityManager.persist(groupMember); + groupMemberId = groupMember.getId(); // 그룹들 List groups = GroupFixture.groups(0, MAX_GROUP_COUNT); groups.forEach(entityManager::persist); + groupId = groups.get(0).getId(); // 그룹원에게 초대온 그룹 초대들 for (int i = 0; i < MAX_GROUP_COUNT; i++) { @@ -65,9 +73,9 @@ void setUp(@Autowired EntityManager entityManager) { } @Test - void 사용자는_자신에게_온_그룹_초대_목록을_조회할_수_있다() { + void 사용자는_자신에게_온_그룹_초대_목록을_조회하면_그룹_초대목록이_나온다() { //given - Long memberId = groupMember.getId(); + Long memberId = groupMemberId; int size = 1; ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); @@ -76,13 +84,13 @@ void setUp(@Autowired EntityManager entityManager) { memberId, size, createAt); //then - assertThat(groupInvitesSummary.getContent()).isNotNull(); + assertThat(groupInvitesSummary.getContent()).isNotEmpty(); } @Test void 사용자는_자신에게_온_그룹_초대_목록에서_그룹_정보와_그룹장을_알_수_있다() { //given - Long memberId = groupMember.getId(); + Long memberId = groupMemberId; int size = 1; ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); @@ -92,28 +100,60 @@ void setUp(@Autowired EntityManager entityManager) { //then SoftAssertions.assertSoftly(softly -> { - Assertions.assertThat(groupInvitesSummary).allMatch(g -> !g.groupName().isEmpty()); - Assertions.assertThat(groupInvitesSummary) + assertThat(groupInvitesSummary).allMatch(g -> !g.groupName().isEmpty()); + assertThat(groupInvitesSummary) .allMatch(g -> !g.groupProfileUrl().isEmpty()); - Assertions.assertThat(groupInvitesSummary).allMatch(g -> !g.description().isEmpty()); - Assertions.assertThat(groupInvitesSummary).allMatch(g -> !g.groupOwnerName().isEmpty()); + assertThat(groupInvitesSummary).allMatch(g -> !g.description().isEmpty()); + assertThat(groupInvitesSummary).allMatch(g -> !g.groupOwnerName().isEmpty()); }); } @Test - void 사용자는_조회한_그룹_초대_목록_후_그룹_초대_존재_여부를_확인_할_수_있다() { + void 사용자는_그룹_초대_받은_목록_첫_페이지를_조회_후_다음_페이지에서_그룹_초대_받은_목록을_조회_할_수_있다() { //given - Long memberId = groupMember.getId(); + Long memberId = groupMemberId; int size = 1; - ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); + ZonedDateTime now = ZonedDateTime.now(ZoneId.of("UTC")).plusDays(3); + Slice firstSlice = groupInviteRepository.findGroupRecetpionInvitesSlice( + memberId, size, now); //when + GroupInviteSummaryDto dto = firstSlice.getContent().get(0); Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( - memberId, size, createAt); + memberId, size, dto.groupReceptionInviteTime()); + + //then + assertThat(groupInvitesSummary.getContent()).isNotEmpty(); + } + + @Test + void 그룹장은_자신이_보낸_그룹_초대_목록을_조회하면_그룹_초대목록이_나온다() { + //given + //when + List groupSendingInvites = groupInviteRepository.findGroupSendingInvites( + groupOwnerId, groupId); //then - assertThat(groupInvitesSummary.hasNext()).isTrue(); + SoftAssertions.assertSoftly(softly -> { + softly.assertThat(groupSendingInvites).isNotEmpty(); + softly.assertThat(groupSendingInvites).allMatch(dto -> dto.id() != null); + softly.assertThat(groupSendingInvites) + .allMatch(dto -> dto.nickname() != null && !dto.nickname().isBlank()); + softly.assertThat(groupSendingInvites) + .allMatch(dto -> dto.profileUrl() != null && !dto.profileUrl().isBlank()); + softly.assertThat(groupSendingInvites) + .allMatch(dto -> dto.sendingInvitesCreatedAt() != null); + }); } + @Test + void 그룹원은_자신이_보낸_그룹_초대_목록을_조회하면_빈_리스트가_나온다() { + //given + //when + List groupSendingInvites = groupInviteRepository.findGroupSendingInvites( + groupMemberId, groupId); + //then + assertThat(groupSendingInvites).isEmpty(); + } } From 6567182de2537de262da00808db4b25d29d38dc5 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Mon, 3 Jun 2024 19:17:57 +0900 Subject: [PATCH 5/8] =?UTF-8?q?fix=20:=20loe=20->=20lt=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 같은 시간인 경우 오류가 발생해 loe -> lt로 변경 --- .../group_invite_repository/GroupInviteQueryRepositoryImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java index c7b115a58..85465284a 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java @@ -92,7 +92,7 @@ public Slice findGroupRecetpionInvitesSlice( .from(groupInvite) .join(groupInvite.group, group) .join(groupInvite.groupOwner, member) - .where(groupInvite.groupMember.id.eq(memberId).and(groupInvite.createdAt.loe(createdAt))) + .where(groupInvite.groupMember.id.eq(memberId).and(groupInvite.createdAt.lt(createdAt))) .limit(size + 1) .fetch(); From e3bac7fe7aca9bbbda5b2098eb60d1d7c288957f Mon Sep 17 00:00:00 2001 From: hong seokho Date: Mon, 3 Jun 2024 19:18:16 +0900 Subject: [PATCH 6/8] =?UTF-8?q?fix=20:=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=B6=A9=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 시간 기반 페이징의 로직 상 오류로 테스트 실패 - 아이디 기반 커서 페이징으로 변경해야 함 --- .../member_group/repository/GroupInviteQueryRepositoryTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java index 1aad3c7de..65910ed1c 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java @@ -120,7 +120,7 @@ void setUp(@Autowired EntityManager entityManager) { //when GroupInviteSummaryDto dto = firstSlice.getContent().get(0); Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( - memberId, size, dto.groupReceptionInviteTime()); + memberId, size, dto.groupReceptionInviteTime().plusSeconds(1L)); //then assertThat(groupInvitesSummary.getContent()).isNotEmpty(); From 603f155bf1d13b543cd8d8e4ee62d27d63c8aae6 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Tue, 4 Jun 2024 22:59:54 +0900 Subject: [PATCH 7/8] =?UTF-8?q?fix=20:=20=EB=8B=A8=EC=96=B4=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 더 명확한 의미를 위해 반의어인 receiving으로 수정 --- .../api/query/MemberGroupQueryApi.java | 4 ++-- .../query/MemberGroupQueryApiController.java | 14 +++++++------- .../data/dto/GroupInviteSummaryDto.java | 10 +++++----- ...> GroupReceivingInviteSummaryResponse.java} | 10 +++++----- ...=> GroupReceivingInvitesSliceResponse.java} | 10 +++++----- .../GroupInviteQueryRepository.java | 2 +- .../GroupInviteQueryRepositoryImpl.java | 18 +++--------------- .../service/MemberGroupQueryService.java | 4 ++-- .../GroupInviteQueryRepositoryTest.java | 10 +++++----- 9 files changed, 35 insertions(+), 47 deletions(-) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/{GroupReceptionInviteSummaryResponse.java => GroupReceivingInviteSummaryResponse.java} (76%) rename backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/{GroupReceptionInvitesSliceResponse.java => GroupReceivingInvitesSliceResponse.java} (64%) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java index b3fc268bd..92489c5c3 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java @@ -8,7 +8,7 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import java.time.ZonedDateTime; import org.springframework.http.ResponseEntity; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInvitesSliceResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceivingInvitesSliceResponse; import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesResponse; import site.timecapsulearchive.core.global.common.response.ApiSpec; @@ -27,7 +27,7 @@ public interface MemberGroupQueryApi { description = "ok" ) }) - ResponseEntity> findGroupReceptionInvites( + ResponseEntity> findGroupReceivingInvites( Long memberId, @Parameter(in = ParameterIn.QUERY, description = "페이지 크기", required = true) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java index 0685b9703..2d1e1e6ff 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApiController.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInvitesSliceResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceivingInvitesSliceResponse; import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesResponse; import site.timecapsulearchive.core.domain.member_group.service.MemberGroupQueryService; import site.timecapsulearchive.core.global.common.response.ApiSpec; @@ -30,24 +30,24 @@ public class MemberGroupQueryApiController implements MemberGroupQueryApi { @GetMapping( - value = "/reception-invites", + value = "/receiving-invites", produces = {"application/json"} ) @Override - public ResponseEntity> findGroupReceptionInvites( + public ResponseEntity> findGroupReceivingInvites( @AuthenticationPrincipal final Long memberId, @RequestParam(defaultValue = "20", value = "size") final int size, @RequestParam(value = "created_at") final ZonedDateTime createdAt ) { - final Slice groupInviteSummarySlice = memberGroupQueryService.findGroupReceptionInvitesSlice( + final Slice groupReceivingInvitesSlice = memberGroupQueryService.findGroupReceivingInvitesSlice( memberId, size, createdAt); return ResponseEntity.ok( ApiSpec.success( SuccessCode.SUCCESS, - GroupReceptionInvitesSliceResponse.createOf( - groupInviteSummarySlice.getContent(), - groupInviteSummarySlice.hasNext(), + GroupReceivingInvitesSliceResponse.createOf( + groupReceivingInvitesSlice.getContent(), + groupReceivingInvitesSlice.hasNext(), s3PreSignedUrlManager::getS3PreSignedUrlForGet ) ) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java index 3d3ec6570..a5fb7fb54 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/dto/GroupInviteSummaryDto.java @@ -3,7 +3,7 @@ import java.time.ZonedDateTime; import java.util.function.Function; import lombok.Builder; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceptionInviteSummaryResponse; +import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceivingInviteSummaryResponse; @Builder public record GroupInviteSummaryDto( @@ -12,19 +12,19 @@ public record GroupInviteSummaryDto( String groupName, String groupProfileUrl, String description, - ZonedDateTime groupReceptionInviteTime, + ZonedDateTime groupReceivingInviteTime, String groupOwnerName ) { - public GroupReceptionInviteSummaryResponse toResponse( + public GroupReceivingInviteSummaryResponse toResponse( final Function preSignedUrlFunction ) { - return GroupReceptionInviteSummaryResponse.builder() + return GroupReceivingInviteSummaryResponse.builder() .groupId(groupId) .groupName(groupName) .groupProfileUrl(preSignedUrlFunction.apply(groupProfileUrl)) .description(description) - .groupReceptionInviteTime(groupReceptionInviteTime) + .groupReceivingInviteTime(groupReceivingInviteTime) .groupOwnerName(groupOwnerName) .build(); } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceivingInviteSummaryResponse.java similarity index 76% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceivingInviteSummaryResponse.java index dff6de490..13d154fff 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInviteSummaryResponse.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceivingInviteSummaryResponse.java @@ -7,7 +7,7 @@ @Builder @Schema(description = "초대온 그룹 요약 정보") -public record GroupReceptionInviteSummaryResponse( +public record GroupReceivingInviteSummaryResponse( @Schema(description = "그룹 아이디") Long groupId, @@ -22,15 +22,15 @@ public record GroupReceptionInviteSummaryResponse( String description, @Schema(description = "그룹 초대 시간") - ZonedDateTime groupReceptionInviteTime, + ZonedDateTime groupReceivingInviteTime, @Schema(description = "그룹장") String groupOwnerName ) { - public GroupReceptionInviteSummaryResponse { - if (groupReceptionInviteTime != null) { - groupReceptionInviteTime = groupReceptionInviteTime.withZoneSameInstant( + public GroupReceivingInviteSummaryResponse { + if (groupReceivingInviteTime != null) { + groupReceivingInviteTime = groupReceivingInviteTime.withZoneSameInstant( ResponseMappingConstant.ZONE_ID); } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInvitesSliceResponse.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceivingInvitesSliceResponse.java similarity index 64% rename from backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInvitesSliceResponse.java rename to backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceivingInvitesSliceResponse.java index 95e5acdd8..815b84658 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceptionInvitesSliceResponse.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/data/response/GroupReceivingInvitesSliceResponse.java @@ -5,23 +5,23 @@ import java.util.function.Function; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; -public record GroupReceptionInvitesSliceResponse( +public record GroupReceivingInvitesSliceResponse( @Schema(description = "초대 온 그룹 요약 정보 리스트") - List responses, + List responses, @Schema(description = "다음 페이지 유무") Boolean hasNext ) { - public static GroupReceptionInvitesSliceResponse createOf( + public static GroupReceivingInvitesSliceResponse createOf( final List dtos, final boolean hasNext, final Function preSignedUrlFunction ) { - List groupReceptionInviteSummaryResponses = dtos.stream() + List groupReceivingInviteSummaryResponse = dtos.stream() .map(dto -> dto.toResponse(preSignedUrlFunction)).toList(); - return new GroupReceptionInvitesSliceResponse(groupReceptionInviteSummaryResponses, + return new GroupReceivingInvitesSliceResponse(groupReceivingInviteSummaryResponse, hasNext); } } diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java index 899883909..c9c5c3166 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepository.java @@ -12,7 +12,7 @@ public interface GroupInviteQueryRepository { List findGroupInviteIdsByGroupIdAndGroupOwnerId(final Long groupId, final Long memberId); - Slice findGroupRecetpionInvitesSlice( + Slice findGroupReceivingInvitesSlice( final Long memberId, final int size, final ZonedDateTime createdAt diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java index 85465284a..fd3b95d2c 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/repository/group_invite_repository/GroupInviteQueryRepositoryImpl.java @@ -22,6 +22,7 @@ import org.springframework.stereotype.Repository; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; +import site.timecapsulearchive.core.global.util.SliceUtil; @Repository @RequiredArgsConstructor @@ -72,7 +73,7 @@ public List findGroupInviteIdsByGroupIdAndGroupOwnerId( } @Override - public Slice findGroupRecetpionInvitesSlice( + public Slice findGroupReceivingInvitesSlice( final Long memberId, final int size, final ZonedDateTime createdAt @@ -96,22 +97,9 @@ public Slice findGroupRecetpionInvitesSlice( .limit(size + 1) .fetch(); - return makeSlice(size, groupInviteSummaryDtos); + return SliceUtil.makeSlice(size, groupInviteSummaryDtos); } - private Slice makeSlice( - final int size, - final List dtos - ) { - final boolean hasNext = dtos.size() > size; - if (hasNext) { - dtos.remove(size); - } - - return new SliceImpl<>(dtos, Pageable.ofSize(size), hasNext); - } - - @Override public List findGroupSendingInvites( final Long memberId, final Long groupId diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java index 90b888beb..e44aa6f7f 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java @@ -17,12 +17,12 @@ public class MemberGroupQueryService { private final GroupInviteRepository groupInviteRepository; - public Slice findGroupReceptionInvitesSlice( + public Slice findGroupReceivingInvitesSlice( final Long memberId, final int size, final ZonedDateTime createdAt ) { - return groupInviteRepository.findGroupRecetpionInvitesSlice(memberId, size, createdAt); + return groupInviteRepository.findGroupReceivingInvitesSlice(memberId, size, createdAt); } public List findGroupSendingInvites( diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java index 65910ed1c..5e8522e18 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/repository/GroupInviteQueryRepositoryTest.java @@ -80,7 +80,7 @@ void setUp(@Autowired EntityManager entityManager) { ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); //when - Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( + Slice groupInvitesSummary = groupInviteRepository.findGroupReceivingInvitesSlice( memberId, size, createAt); //then @@ -95,7 +95,7 @@ void setUp(@Autowired EntityManager entityManager) { ZonedDateTime createAt = ZonedDateTime.now().plusDays(1); //when - Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( + Slice groupInvitesSummary = groupInviteRepository.findGroupReceivingInvitesSlice( memberId, size, createAt); //then @@ -114,13 +114,13 @@ void setUp(@Autowired EntityManager entityManager) { Long memberId = groupMemberId; int size = 1; ZonedDateTime now = ZonedDateTime.now(ZoneId.of("UTC")).plusDays(3); - Slice firstSlice = groupInviteRepository.findGroupRecetpionInvitesSlice( + Slice firstSlice = groupInviteRepository.findGroupReceivingInvitesSlice( memberId, size, now); //when GroupInviteSummaryDto dto = firstSlice.getContent().get(0); - Slice groupInvitesSummary = groupInviteRepository.findGroupRecetpionInvitesSlice( - memberId, size, dto.groupReceptionInviteTime().plusSeconds(1L)); + Slice groupInvitesSummary = groupInviteRepository.findGroupReceivingInvitesSlice( + memberId, size, dto.groupReceivingInviteTime().plusSeconds(1L)); //then assertThat(groupInvitesSummary.getContent()).isNotEmpty(); From 69d0cf6f39fa1d8422330af3753869c58f60fcc2 Mon Sep 17 00:00:00 2001 From: hong seokho Date: Tue, 4 Jun 2024 23:32:13 +0900 Subject: [PATCH 8/8] =?UTF-8?q?fix=20:=20=EB=A8=B8=EC=A7=80=20=EC=B6=A9?= =?UTF-8?q?=EB=8F=8C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - import 경로 수정 --- .../member_group/api/query/MemberGroupQueryApi.java | 3 +-- .../member_group/service/MemberGroupCommandService.java | 7 +++---- .../member_group/service/MemberGroupQueryService.java | 3 +-- .../service/MemberGroupCommandServiceTest.java | 8 ++++---- .../core/infrastructure/RedisConcurrencyTest.java | 4 ++-- 5 files changed, 11 insertions(+), 14 deletions(-) diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java index 803c81b57..9d4efaebc 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/api/query/MemberGroupQueryApi.java @@ -8,10 +8,9 @@ import io.swagger.v3.oas.annotations.security.SecurityRequirement; import java.time.ZonedDateTime; import org.springframework.http.ResponseEntity; +import site.timecapsulearchive.core.domain.group.data.response.GroupMemberInfosResponse; import site.timecapsulearchive.core.domain.member_group.data.response.GroupReceivingInvitesSliceResponse; import site.timecapsulearchive.core.domain.member_group.data.response.GroupSendingInvitesResponse; -import site.timecapsulearchive.core.domain.group.data.response.GroupMemberInfosResponse; -import site.timecapsulearchive.core.domain.member_group.data.response.GroupInviteSummaryResponses; import site.timecapsulearchive.core.global.common.response.ApiSpec; public interface MemberGroupQueryApi { diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java index 25cf1fe49..35dc7b94c 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandService.java @@ -20,11 +20,9 @@ import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupKickDuplicatedIdException; import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.exception.NoGroupAuthorityException; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; -import site.timecapsulearchive.core.global.config.redis.RedissonLock; import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; +import site.timecapsulearchive.core.global.config.redis.RedissonLock; import site.timecapsulearchive.core.infra.queue.manager.SocialNotificationManager; @Service @@ -98,7 +96,8 @@ public GroupAcceptNotificationDto acceptGroupInvite(final Long memberId, final L return new GroupAcceptNotificationDto(groupMember.getNickname(), groupOwnerId); } - private void deleteGroupInvite(final Long memberId, final Long groupId, final Long groupOwnerId) { + private void deleteGroupInvite(final Long memberId, final Long groupId, + final Long groupOwnerId) { final int isDenyRequest = groupInviteRepository.deleteGroupInviteByGroupIdAndGroupOwnerIdAndGroupMemberId( groupId, groupOwnerId, memberId); if (isDenyRequest != 1) { diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java index e62f7b264..dd8141997 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupQueryService.java @@ -9,10 +9,9 @@ import site.timecapsulearchive.core.domain.group.data.dto.GroupMemberDto; import site.timecapsulearchive.core.domain.group.exception.GroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupInviteSummaryDto; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; import site.timecapsulearchive.core.domain.member_group.data.dto.GroupSendingInviteMemberDto; import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; @Service @RequiredArgsConstructor diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java index 4f983a78c..955a6eaf4 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/domain/member_group/service/MemberGroupCommandServiceTest.java @@ -38,8 +38,6 @@ import site.timecapsulearchive.core.domain.member_group.exception.MemberGroupNotFoundException; import site.timecapsulearchive.core.domain.member_group.exception.NoGroupAuthorityException; import site.timecapsulearchive.core.domain.member_group.facade.MemberGroupFacade; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; import site.timecapsulearchive.core.global.error.ErrorCode; @@ -213,7 +211,8 @@ class MemberGroupCommandServiceTest { given(memberRepository.findMemberById(memberId)).willReturn(Optional.of(groupMember)); given(groupRepository.findGroupById(groupId)).willReturn( Optional.of(GroupFixture.group())); - given(memberGroupRepository.findGroupOwnerId(groupId)).willReturn(Optional.of(groupOwnerId)); + given(memberGroupRepository.findGroupOwnerId(groupId)).willReturn( + Optional.of(groupOwnerId)); given(groupInviteRepository.deleteGroupInviteByGroupIdAndGroupOwnerIdAndGroupMemberId( groupId, groupOwnerId, memberId)).willReturn(1); @@ -225,7 +224,8 @@ class MemberGroupCommandServiceTest { //then SoftAssertions.assertSoftly( softly -> { - assertThat(groupAcceptNotificationDto.groupMemberNickname()).isEqualTo(groupMember.getNickname()); + assertThat(groupAcceptNotificationDto.groupMemberNickname()).isEqualTo( + groupMember.getNickname()); assertThat(groupAcceptNotificationDto.groupOwnerId()).isEqualTo(groupOwnerId); } ); diff --git a/backend/core/src/test/java/site/timecapsulearchive/core/infrastructure/RedisConcurrencyTest.java b/backend/core/src/test/java/site/timecapsulearchive/core/infrastructure/RedisConcurrencyTest.java index dfebd87e9..b86d3999b 100644 --- a/backend/core/src/test/java/site/timecapsulearchive/core/infrastructure/RedisConcurrencyTest.java +++ b/backend/core/src/test/java/site/timecapsulearchive/core/infrastructure/RedisConcurrencyTest.java @@ -27,8 +27,8 @@ import site.timecapsulearchive.core.domain.member.entity.Member; import site.timecapsulearchive.core.domain.member.repository.MemberRepository; import site.timecapsulearchive.core.domain.member_group.facade.MemberGroupFacade; -import site.timecapsulearchive.core.domain.member_group.repository.groupInviteRepository.GroupInviteRepository; -import site.timecapsulearchive.core.domain.member_group.repository.memberGroupRepository.MemberGroupRepository; +import site.timecapsulearchive.core.domain.member_group.repository.group_invite_repository.GroupInviteRepository; +import site.timecapsulearchive.core.domain.member_group.repository.member_group_repository.MemberGroupRepository; import site.timecapsulearchive.core.domain.member_group.service.MemberGroupCommandService; import site.timecapsulearchive.core.global.error.ErrorCode; import site.timecapsulearchive.core.global.error.exception.RedisLockException;