| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
| | | import org.springframework.web.util.pattern.PathPatternParser; |
| | | |
| | | /** |
| | | * Web配置类 |
| | | */ |
| | | @Configuration |
| | | public class WebConfig { |
| | | public class WebConfig implements WebMvcConfigurer { |
| | | |
| | | @Bean |
| | | public RestTemplate restTemplate() { |
| | | return new RestTemplate(); |
| | | } |
| | | |
| | | @Override |
| | | public void configurePathMatch(PathMatchConfigurer configurer) { |
| | | // 使用PathPatternParser而不是AntPathMatcher |
| | | configurer.setPatternParser(new PathPatternParser()); |
| | | } |
| | | } |