package top.continew.admin.config.file;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

import java.io.File;

/**
 * @Author:
 * @Date: 2022/09/29/11:26
 * @Description:
 */

@Configuration
public class ConstantConfig {

    @Value("${common.file.path}")
    private String path;

    public String getPath() {
        File file = new File(path);
        if (!file.exists() && !file.isDirectory()) {
            file.mkdirs();
        }
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }
}
