All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dahuatech.icc.alarm.Constant.AlarmConstant Maven / Gradle / Ivy

package com.dahuatech.icc.alarm.Constant;

import com.dahuatech.hutool.core.util.StrUtil;
import com.dahuatech.hutool.log.Log;
import com.dahuatech.hutool.log.LogFactory;
import com.dahuatech.icc.oauth.profile.IccProfile;

/**
 * program:java-sdk
 *
 * @Author: 355079
 * @Date:2022-08-18 09:18
 * @Description:
 */
public class AlarmConstant {
    /** 模块名称 */
    public static final String SYSTEM_NAME = "evo-alarm";
    /**************************** 远程控制 ****************************/
    public static final String ALARM_HOSTS_OPERATE_GET="/evo-apigw/evo-alarm/1.0.0/alarmhosts/operate";
    public static final String ALARM_HOSTS_OPERATE_POST="/evo-apigw/evo-alarm/1.0.0/alarmhosts/operate";

    /**************************** 状态查询 ****************************/
    public static final String ALARM_HOSTS_ALL="/evo-apigw/evo-alarm/1.0.0/alarmhosts/all";
    public static final String ALARM_HOSTS_ONE="/evo-apigw/evo-alarm/1.0.0/alarmhosts/one";

    private static final Log logger = LogFactory.get();

    /** 非必填 */
    public static String version = "";

    private static boolean initVersionFromBrm = Boolean.FALSE;

    public static String url(String url) {
        // 加载远程版本信息
        initVersion();
        return String.format(IccProfile.URL_SCHEME + url, version);
    }

    public static String url(String url, Object rest) {
        // 加载远程版本信息
        initVersion();
        return StrUtil.format(String.format(IccProfile.URL_SCHEME + url, version), rest);
    }

    private static void initVersion() {
        if (!initVersionFromBrm && IccProfile.systemVersionMap.containsKey(SYSTEM_NAME)) {
            version = IccProfile.systemVersionMap.get(SYSTEM_NAME);
            initVersionFromBrm = true;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy