implemented basic search function with Homebox provider
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package com.vaessl.app.search;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.data.domain.Page;
|
||||
|
||||
public record PagedSearchResponse<T>(List<T> content, int page, int pageSize, long totalElements,
|
||||
boolean first, boolean last, String sort) {
|
||||
|
||||
public static <T> PagedSearchResponse<T> from(Page<T> pageResult) {
|
||||
return new PagedSearchResponse<>(pageResult.getContent(), pageResult.getNumber(),
|
||||
pageResult.getSize(), pageResult.getTotalElements(), pageResult.isFirst(),
|
||||
pageResult.isLast(), pageResult.getSort().toString());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user