package com.platform.yijia.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;

/***
 * <Title> WebMvcConfig </Title>
 * <Description> 添加与WebMvc相关的自定义配置 </Description>
 * @Author JK
 * @Date 2021年5月25日
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Resource
    private YiJiaPathProperties yiJiaPathProperties;

    //统一后台接口路径访问前缀
    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        configurer.addPathPrefix(yiJiaPathProperties.getGlobalPrefix(), c -> c.isAnnotationPresent(YiJiaRequest.class));
    }
}
