package com.yeshi.buwan.query;
|
|
import org.springframework.data.domain.Sort;
|
import org.springframework.data.mongodb.core.query.Query;
|
|
import java.util.List;
|
|
public class BaseQuery {
|
public long start;
|
public int count;
|
|
public static Query createBaseMongoQuery(BaseQuery baseQuery, List<Sort.Order> sortList) {
|
Query query = new Query();
|
query.skip((int) baseQuery.start);
|
query.limit(baseQuery.count);
|
if (sortList != null) {
|
query.with(new Sort(sortList));
|
}
|
return query;
|
}
|
}
|