org.springframework.data.domain.Pageable
This commit is contained in:
parent
c6aba2caa9
commit
54512eef0c
|
|
@ -4,8 +4,10 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
|||
import com.alibaba.fastjson.support.config.FastJsonConfig;
|
||||
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.converter.HttpMessageConverter;
|
||||
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
|
|
@ -17,6 +19,7 @@ public class fastJsonConfig extends WebMvcConfigurationSupport {
|
|||
|
||||
/**
|
||||
* 使用阿里 fastjson 作为JSON MessageConverter
|
||||
*
|
||||
* @param converters
|
||||
*/
|
||||
@Override
|
||||
|
|
@ -45,4 +48,10 @@ public class fastJsonConfig extends WebMvcConfigurationSupport {
|
|||
converter.setSupportedMediaTypes(mediaTypeList);
|
||||
converters.add(converter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
|
||||
// 注册Spring data jpa pageable的参数分解器
|
||||
argumentResolvers.add(new PageableHandlerMethodArgumentResolver());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue