com.dahuatech.icc.jpatrol.constant.JpatrolConstant Maven / Gradle / Ivy
package com.dahuatech.icc.jpatrol.constant;
import com.dahuatech.hutool.core.util.StrUtil;
import com.dahuatech.icc.oauth.profile.IccProfile;
/**
* program:java-sdk
*
* Author:355079
* Date:2022-08-11 16:30
* Description: 巡更子系统常量类
*/
public class JpatrolConstant {
/** 模块名称 */
public static final String SYSTEM_NAME = "evo-jpatrol";
/** 查询当月计划 */
public static final String RULE_LIST = "/evo-apigw/evo-jpatrol/1.0.0/rule/list";
/** 查询巡更计划详情 */
public static final String RULE_ID="/evo-apigw/evo-jpatrol/1.0.0/rule/";
/** 查询某日排班 */
public static final String RULE_DAYS="/evo-apigw/evo-jpatrol/1.0.0/rule/days";
/** 新增计划 */
public static final String RULE="/evo-apigw/evo-jpatrol/1.0.0/rule";
/** 查询记录 */
public static final String RECORD_PAGE="/evo-apigw/evo-jpatrol/1.0.0/record/page";
/** 巡更异常率统计 */
public static final String RECORD_STATISTICAL="/evo-apigw/evo-jpatrol/1.0.0/record/statistical";
/** 非必填 */
public static String version = "1.0.0/";
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;
}
}
}