package cn.iocoder.yudao.module.smartfactory.constant;

import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@Slf4j
public class ArtemisConfigConstant implements CommandLineRunner {


    public static String host;
    public static String appKey;
    public static String appSecret;

    @Value("${isc.host}")
    public void setHost(String a) {
        host = a;
        ArtemisConfig.host = a;
    }

    @Value("${isc.appKey}")
    public void setAppKey(String a) {
        appKey = a;
        ArtemisConfig.appKey = a;
    }

    @Value("${isc.appSecret}")
    public void setAppSecret(String a) {
        appSecret = a;
        ArtemisConfig.appSecret = a;
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("# 【ArtemisConfigConstant】 host：{} #", ArtemisConfigConstant.host);
        log.info("# 【ArtemisConfigConstant】 appKey：{} #", ArtemisConfigConstant.appKey);
        log.info("# 【ArtemisConfigConstant】 appSecret：{} #", ArtemisConfigConstant.appSecret);
    }

}
