package com.xhkjedu.slive.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author ywx
 * @classname ConfigKey
 * @description 读取配置文件类
 * @date 2020/10/16 9:19
 **/
@Component
public class ConfigKey {
    public static Integer redisdatatime;//缓存访问数据有效时长
    public static String secretKey;//secretKey必须为24位

    @Value("${redisdatatime}")
    public void setRedisdatatime(Integer redisdatatime) {
        ConfigKey.redisdatatime = redisdatatime;
    }

    @Value("${secretKey}")
    public void setSecretKey(String secretKey) {
        ConfigKey.secretKey = secretKey;
    }

    public static String address;

    @Value("${ws.address}")
    public void setAddress(String address) {
        ConfigKey.address = address;
    }

    public static String cloudapi;//云平台接口
    @Value("${cloudapi}")
    public void setCloudapi(String cloudapi) {
        this.cloudapi = cloudapi;
    }

    public static String appId;
    public static String appCertificate;
    public static Integer expirationTimeInSeconds;

    @Value("${agora.appId}")
    public void setAppId(String appId) {
        ConfigKey.appId = appId;
    }

    @Value("${agora.appCertificate}")
    public void setAppCertificate(String appCertificate) {
        ConfigKey.appCertificate = appCertificate;
    }

    @Value("${agora.expirationTimeInSeconds}")
    public void setExpirationTimeInSeconds(Integer expirationTimeInSeconds) {
        ConfigKey.expirationTimeInSeconds = expirationTimeInSeconds;
    }
}
