-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #465 from tukcomCD2024/feat/group_invite_list-B-#458
feat : 그룹 초대 받은 목록, 보낸 목록 API 추가
- Loading branch information
Showing
23 changed files
with
286 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ite/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInviteMemberDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...e/timecapsulearchive/core/domain/member_group/data/dto/GroupSendingInvitesRequestDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...psulearchive/core/domain/member_group/data/response/GroupSendingInviteMemberResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
...imecapsulearchive/core/domain/member_group/data/response/GroupSendingInvitesResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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 GroupSendingInvitesResponse( | ||
|
||
@Schema(description = "초대 보낸 그룹원 정보 리스트") | ||
List<GroupSendingInviteMemberResponse> responses | ||
) { | ||
|
||
public static GroupSendingInvitesResponse createOf( | ||
final List<GroupSendingInviteMemberDto> groupSendingInviteMemberDtos | ||
) { | ||
List<GroupSendingInviteMemberResponse> groupSendingInviteMemberResponses = groupSendingInviteMemberDtos.stream() | ||
.map(GroupSendingInviteMemberDto::toResponse) | ||
.toList(); | ||
|
||
return new GroupSendingInvitesResponse(groupSendingInviteMemberResponses); | ||
} | ||
} |
10 changes: 8 additions & 2 deletions
10
...epository/GroupInviteQueryRepository.java → ...epository/GroupInviteQueryRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,25 @@ | ||
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; | ||
|
||
public interface GroupInviteQueryRepository { | ||
|
||
void bulkSave(final Long groupOwnerId, final Long groupId, final List<Long> groupMemberIds); | ||
|
||
List<Long> findGroupInviteIdsByGroupIdAndGroupOwnerId(final Long groupId, final Long memberId); | ||
|
||
Slice<GroupInviteSummaryDto> findGroupInvitesSummary( | ||
Slice<GroupInviteSummaryDto> findGroupReceivingInvitesSlice( | ||
final Long memberId, | ||
final int size, | ||
final ZonedDateTime createdAt | ||
); | ||
|
||
List<GroupSendingInviteMemberDto> findGroupSendingInvites( | ||
final Long memberId, | ||
final Long groupId | ||
); | ||
} |
Oops, something went wrong.