package com.saye.hospitalgd.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * Description: 配置虚拟路径
 * @author dqzhang
 * @created 2019年11月19日 下午3:26:06
 */

@Configuration
public class VirtualPathConfig extends WebMvcConfigurationSupport{

	@Override
	protected void addResourceHandlers(ResourceHandlerRegistry registry) {
		//这样会在项目当前盘符下创建saye文件夹
		registry.addResourceHandler("/showFile/**").addResourceLocations("file:/saye/");
		registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");

		/*swagger 404静态资源配置*/
		registry.addResourceHandler("/swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");
		registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");

		super.addResourceHandlers(registry);
	}
}