package cn.superdesk.uniorder.common;

import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.io.InputStream;
import java.util.Properties;

/**
 * @Description: 老的产物 计划弃用
 * @Author: linjinyu
 * @CreateDate: 2021/10/27 下午2:44
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/10/27 下午2:44
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@NoArgsConstructor
@Slf4j
@Deprecated
public class PropertiesKit {

    public static String readPropertiesValue(String key, String configFileName) {

        Properties properties = new Properties();

        try {
            InputStream profile = Thread
                    .currentThread()
                    .getContextClassLoader()
                    .getResourceAsStream(configFileName);

            properties.load(profile);

            String value = properties.getProperty(key);

            profile.close();

            return value;

        } catch (Exception e) {

            log.error(">>>>key&configFileName:{}}&{}" + key, configFileName);
            log.error("logError:EcwxUtils readPropertiesValue occur error. \n{}", e.getMessage());
            return null;
        }
    }
}
