PaginationConfiguration.java 1.1 KB

1234567891011121314151617181920212223242526
  1. package com.zswl.dataservicestarter.config;
  2. import org.springframework.beans.factory.ObjectFactory;
  3. import org.springframework.context.ApplicationContext;
  4. import org.springframework.context.annotation.Bean;
  5. import org.springframework.context.annotation.Configuration;
  6. import org.springframework.core.convert.ConversionService;
  7. import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
  8. import org.springframework.data.web.config.SpringDataWebConfiguration;
  9. @Configuration
  10. public class PaginationConfiguration extends SpringDataWebConfiguration {
  11. public PaginationConfiguration(ApplicationContext context, ObjectFactory<ConversionService> conversionService) {
  12. super(context, conversionService);
  13. }
  14. @Bean
  15. @Override
  16. public PageableHandlerMethodArgumentResolver pageableResolver() {
  17. PageableHandlerMethodArgumentResolver pageableHandlerMethodArgumentResolver = new PageableHandlerMethodArgumentResolver(sortResolver());
  18. pageableHandlerMethodArgumentResolver.setMaxPageSize(Integer.MAX_VALUE);
  19. return pageableHandlerMethodArgumentResolver;
  20. }
  21. }