package com.fs.im.config;

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

import javax.annotation.PostConstruct;

@Component
//@ConfigurationProperties(prefix = "openIM")
public class IMConfig {
    @Value("${openIM.secret}")
    private String secret;
    @Value("${openIM.userID}")
    private String userID;
    @Value("${openIM.url}")
    private String url;
//    @Value("${openIM.prefix}")
//    private String prefix;
    // 静态常量
    public static String PREFIX;
    public static String URL;

    @PostConstruct
    public void init() {
//        PREFIX = this.prefix;
        URL = this.url;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

//    public String getPrefix() {
//        return prefix;
//    }
//
//    public void setPrefix(String scrm) {
//        this.prefix = scrm;
//    }
}
