-
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 #489 from tukcomCD2024/refact/common_dto-B-#479
feat : 그룹 캡슐 목록 조회 #476
- Loading branch information
Showing
10 changed files
with
295 additions
and
40 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
18 changes: 18 additions & 0 deletions
18
...apsulearchive/core/domain/capsule/group_capsule/data/dto/GroupCapsuleSliceRequestDto.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,18 @@ | ||
package site.timecapsulearchive.core.domain.capsule.group_capsule.data.dto; | ||
|
||
public record GroupCapsuleSliceRequestDto( | ||
Long memberId, | ||
Long groupId, | ||
int size, | ||
Long lastCapsuleId | ||
) { | ||
|
||
public static GroupCapsuleSliceRequestDto createOf( | ||
final Long memberId, | ||
final Long groupId, | ||
final int size, | ||
final Long lastCapsuleId | ||
) { | ||
return new GroupCapsuleSliceRequestDto(memberId, groupId, size, lastCapsuleId); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...ulearchive/core/domain/capsule/group_capsule/data/response/GroupCapsuleSliceResponse.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,30 @@ | ||
package site.timecapsulearchive.core.domain.capsule.group_capsule.data.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import java.util.List; | ||
import java.util.function.UnaryOperator; | ||
import site.timecapsulearchive.core.domain.capsule.data.dto.CapsuleBasicInfoDto; | ||
import site.timecapsulearchive.core.domain.capsule.data.response.CapsuleBasicInfoResponse; | ||
|
||
@Schema(description = "그룹 캡슐 목록 응답") | ||
public record GroupCapsuleSliceResponse( | ||
|
||
@Schema(description = "캡슐 기본 정보 목록") | ||
List<CapsuleBasicInfoResponse> capsuleBasicInfos, | ||
|
||
@Schema(description = "다음 페이지 유무") | ||
boolean hasNext | ||
) { | ||
|
||
public static GroupCapsuleSliceResponse create( | ||
final List<CapsuleBasicInfoDto> dtos, | ||
final boolean hasNext, | ||
final UnaryOperator<String> preSignUrlFunction | ||
) { | ||
List<CapsuleBasicInfoResponse> capsuleBasicInfoResponses = dtos.stream() | ||
.map(dto -> dto.toResponse(preSignUrlFunction)) | ||
.toList(); | ||
|
||
return new GroupCapsuleSliceResponse(capsuleBasicInfoResponses, hasNext); | ||
} | ||
} |
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
21 changes: 21 additions & 0 deletions
21
...test/java/site/timecapsulearchive/core/common/fixture/dto/CapsuleBasicInfoDtoFixture.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,21 @@ | ||
package site.timecapsulearchive.core.common.fixture.dto; | ||
|
||
import java.time.ZonedDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
import site.timecapsulearchive.core.domain.capsule.data.dto.CapsuleBasicInfoDto; | ||
import site.timecapsulearchive.core.domain.capsule.entity.CapsuleType; | ||
|
||
public class CapsuleBasicInfoDtoFixture { | ||
|
||
public static List<CapsuleBasicInfoDto> capsuleBasicInfoDtos(Long capsuleId, int size) { | ||
List<CapsuleBasicInfoDto> result = new ArrayList<>(); | ||
for (long count = capsuleId; count < size; count++) { | ||
result.add(new CapsuleBasicInfoDto(count, count + "test-url", ZonedDateTime.now(), | ||
ZonedDateTime.now(), count + "test-title", false, CapsuleType.GROUP)); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
} |
Oops, something went wrong.