package com.zzsn.config;

import com.zzsn.constant.FileConstant;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @ClassName: FileConfig
 * @Description: 图片读取
 * @Auth: Sunty
 * @Date: 2020/4/6 12:29
 * @Version: 1.0.0
 **/
@Configuration
public class FileConfig extends WebMvcConfigurationSupport {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        //图片文件
        registry.addResourceHandler(FileConstant.IMG_VIR_PATH + FileConstant.ACCESS_SUFFIX).
                addResourceLocations(FileConstant.FILE_PREFIX + Global.getProfile());
        super.addResourceHandlers(registry);
    }
}
