package com.trade.service.filestorage.config;


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

import com.trade.service.filestorage.util.FileUtil;

/**
 * 系统自定义相关配置
 */
@Configuration
public class CustomConfiguration implements WebMvcConfigurer {

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/" + FileUtil.DIR + "/**")
                .addResourceLocations("file:" + FileUtil.getAbsoluteDir() + "/" + FileUtil.DIR + "/");
    }
}
