|
@@ -1,7 +1,6 @@
|
|
|
package com.chelvc.framework.base.converter;
|
|
|
|
|
|
import com.chelvc.framework.common.model.Paging;
|
|
|
-import com.chelvc.framework.common.util.AssertUtils;
|
|
|
import org.springframework.core.convert.converter.Converter;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -13,16 +12,8 @@ import org.springframework.stereotype.Component;
|
|
|
*/
|
|
|
@Component
|
|
|
public class StringPagingConverter implements Converter<String, Paging> {
|
|
|
- /**
|
|
|
- * 最大页面大小
|
|
|
- */
|
|
|
- private static final int MAX_SIZE = 1000;
|
|
|
-
|
|
|
@Override
|
|
|
public Paging convert(String source) {
|
|
|
- Paging paging = Paging.parse(source);
|
|
|
- AssertUtils.check(paging == null || paging.getSize() <= MAX_SIZE,
|
|
|
- () -> "Page's size must be less than or equal to " + MAX_SIZE);
|
|
|
- return paging;
|
|
|
+ return Paging.parse(source);
|
|
|
}
|
|
|
}
|