com.dahuatech.icc.electricity.constant.ElectricityConstant Maven / Gradle / Ivy
The newest version!
package com.dahuatech.icc.electricity.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-22 09:31
* @Description: 智慧用电子系统常量类
*/
public class ElectricityConstant {
/** 模块名称 */
public static final String SYSTEM_NAME = "evo-electricity";
/** 综合查询 */
public static final String GET_OTHER_DATA="/evo-apigw/evo-electricity/1.0.0/history/getOtherData";
/** 获取设备能力 */
public static final String DEVICE_INFO="/evo-apigw/evo-electricity/1.0.0/electricity/device/info";
/** 下发单个空开阈值 */
public static final String AIR_SWITCH_SET="/evo-apigw/evo-electricity/1.0.0/electricity/device/airSwitch/set";
/** 用能统计 */
public static final String ENERGY_COUNT="/evo-apigw/evo-electricity/1.0.0/energyCount/getCurrentByCondition";
/** APP端用电统计 */
public static final String ENERGY_COUNT_APP="/evo-apigw/evo-electricity/1.0.0/energyCount/app/getCurrentByCondition";
/** 根据条件查询空调信息 */
public static final String AIR_CONDITIONER_SEARCH="/evo-apigw/evo-electricity/1.0.0/airConditioner/search";
/** 批量设置空调属性 */
public static final String CONTROL_MULTI="/evo-apigw/evo-electricity/1.0.0/airConditioner/controlMulti";
/** 全部/异常信息显示、手动刷新 */
public static final String SHOW_INFOS="/evo-apigw/evo-electricity/1.0.0/electric-energy-detection/showInfos";
/** 批量开启/关闭、单个设备开启/关闭 */
public static final String DEVICES_OPERATOR="/evo-apigw/evo-electricity/1.0.0/electric-energy-detection/devicesOperator";
/** ios端批量/单个开启、关闭 */
public static final String IOS_DEVICES_OPERATOR="/evo-apigw/evo-electricity/1.0.0/electric-energy-detection/ios/devicesOperator";
private static final Log logger = LogFactory.get();
/** 非必填 */
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;
}
}
}