@author 安逸i @version 1.0
| 15 | * @version 1.0 |
| 16 | */ |
| 17 | @Slf4j |
| 18 | @Configuration |
| 19 | public class WebConfig extends WebMvcConfigurationSupport { |
| 20 | @Override |
| 21 | protected void addResourceHandlers(ResourceHandlerRegistry registry) { |
| 22 | log.info("资源映射开始。。"); |
| 23 | registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/"); |
| 24 | registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/"); |
| 25 | } |
| 26 | |
| 27 | @Override |
| 28 | protected void extendMessageConverters(List<HttpMessageConverter<?>> converters) { |
| 29 | // 添加一个转换器,除自带八大转换器外,将Long装成String |
| 30 | MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter(); |
| 31 | converter.setObjectMapper(new JacksonObjectMapper()); |
| 32 | converters.add(0,converter); |
| 33 | } |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected