-
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 #221 from Team-TenTen/develop
Develop
- Loading branch information
Showing
23 changed files
with
466 additions
and
135 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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/tenten/linkhub/domain/space/common/CursorPageMataData.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,9 @@ | ||
package com.tenten.linkhub.domain.space.common; | ||
|
||
public record CursorPageMataData( | ||
Long lastFavoriteCount, | ||
Long lastId, | ||
Integer pageSize, | ||
Boolean hasNext | ||
) { | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/com/tenten/linkhub/domain/space/common/SpaceCursorPageRequest.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,24 @@ | ||
package com.tenten.linkhub.domain.space.common; | ||
|
||
import com.tenten.linkhub.domain.space.model.category.Category; | ||
import org.springframework.data.domain.Sort; | ||
import org.springframework.util.StringUtils; | ||
|
||
public record SpaceCursorPageRequest( | ||
int pageSize, | ||
Sort sort, | ||
Category filter | ||
) { | ||
|
||
public static SpaceCursorPageRequest of( | ||
int pageSize, | ||
String sort, | ||
Category filter | ||
) { | ||
return new SpaceCursorPageRequest( | ||
pageSize, | ||
StringUtils.hasText(sort) ? Sort.by(sort) : Sort.unsorted(), | ||
filter); | ||
} | ||
|
||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/com/tenten/linkhub/domain/space/common/SpaceCursorSlice.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,49 @@ | ||
package com.tenten.linkhub.domain.space.common; | ||
|
||
import lombok.Getter; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.function.Function; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
public class SpaceCursorSlice<T> { | ||
private final Long lastFavoriteCount; | ||
private final Long lastId; | ||
private final Integer pageSize; | ||
private final Boolean hasNext; | ||
private final List<T> content; | ||
|
||
public SpaceCursorSlice(Long lastFavoriteCount, Long lastId, Integer pageSize, Boolean hasNext, List<T> content) { | ||
this.lastFavoriteCount = lastFavoriteCount; | ||
this.lastId = lastId; | ||
this.pageSize = pageSize; | ||
this.hasNext = hasNext; | ||
this.content = new ArrayList<>(content); | ||
} | ||
|
||
public static <T> SpaceCursorSlice<T> of(Long lastFavoriteCount, Long lastId, Integer pageSize, Boolean hasNext, List<T> content) { | ||
return new SpaceCursorSlice<>( | ||
lastFavoriteCount, | ||
lastId, | ||
pageSize, | ||
hasNext, | ||
content | ||
); | ||
} | ||
|
||
public <U> SpaceCursorSlice<U> map(Function<? super T, ? extends U> converter) { | ||
List<U> newContent = content.stream() | ||
.map(converter) | ||
.collect(Collectors.toList()); | ||
return new SpaceCursorSlice<>( | ||
lastFavoriteCount, | ||
lastId, | ||
pageSize, | ||
hasNext, | ||
newContent | ||
); | ||
} | ||
|
||
} |
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
30 changes: 0 additions & 30 deletions
30
...m/tenten/linkhub/domain/space/repository/common/dto/SpaceAndSpaceImageOwnerNickNames.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.