| | |
| | | import javax.annotation.Resource; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.Ordered; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.converter.HttpMessageConverter; |
| | | import org.springframework.util.AntPathMatcher; |
| | | import org.springframework.web.servlet.config.annotation.*; |
| | | |
| | | import java.nio.charset.Charset; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | protected void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/druid/**").addResourceLocations("classpath:/META-INF/resources/druid/"); |
| | | registry.addResourceHandler("/**").addResourceLocations("classpath:/static/"); |
| | | super.addResourceHandlers(registry); |
| | | } |
| | |
| | | |
| | | converter.setFastJsonConfig(config); |
| | | converter.setDefaultCharset(StandardCharsets.UTF_8); |
| | | converter.setSupportedMediaTypes(Collections.singletonList( |
| | | MediaType.APPLICATION_JSON |
| | | )); |
| | | converters.add(converter); |
| | | } |
| | | } |