package top.continew.admin.config.file;

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

/**
 * @Author:
 * @Date: 2025/05/28/14:58
 * @Description:
 */

@Configuration
public class ResourceConfig implements WebMvcConfigurer {
    @Resource
    private ConstantConfig constantConfig;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/downFile/**").addResourceLocations("file:" + constantConfig.getPath());
    }
}
