package com.seeyon.apps.esign.config;

import com.seeyon.apps.common.config.ICstConfigApi;
import com.seeyon.apps.common.plugin.vo.ConfigVo;
import com.seeyon.apps.esign.constants.EsignConfigConstants;
import com.seeyon.ctp.common.AppContext;

import static com.seeyon.apps.esign.constants.EsignConfigConstants.getPluginId;

public class EsignConfigProvider {

    protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");

    public String getBizConfigByKey(EsignConfigConstants key) {
        ConfigVo config = cstConfigApi.getConfig(getPluginId());
        return config.getParamVal(key.name());
    }

    public static EsignConfigProvider getInstance() {
       return (EsignConfigProvider) AppContext.getBean("esignConfigProvider");
    }
}
