MCPcopy Create free account
hub / github.com/Easesgr/reggie / WebConfig

Class WebConfig

src/main/java/com/anyi/reggie/config/WebConfig.java:17–34  ·  view source on GitHub ↗

@author 安逸i @version 1.0

Source from the content-addressed store, hash-verified

15 * @version 1.0
16 */
17@Slf4j
18@Configuration
19public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected