com.dahuatech.icc.electricity.model.v202208.energy.EnergyCountRequest Maven / Gradle / Ivy
package com.dahuatech.icc.electricity.model.v202208.energy;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.common.ParamValidEnum;
import com.dahuatech.icc.electricity.constant.ElectricityConstant;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.oauth.exception.BusinessException;
import com.dahuatech.icc.oauth.http.AbstractIccRequest;
import com.dahuatech.icc.oauth.model.v202010.HttpConfigInfo;
import com.dahuatech.icc.util.StringUtils;
import java.util.List;
/**
* program:java-sdk
*
* @Author: 355079
* @Date:2022-08-22 13:42
* @Description:
*/
public class EnergyCountRequest extends AbstractIccRequest {
private Integer orgType;
private Integer dateType;
private List orgData;
private List deviceCode;
private List channelId;
private String date;
private String airSwitchType;
public Integer getOrgType() {
return orgType;
}
public void setOrgType(Integer orgType) {
putBodyParameter("orgType",orgType);
this.orgType = orgType;
}
public Integer getDateType() {
return dateType;
}
public void setDateType(Integer dateType) {
putBodyParameter("dateType",dateType);
this.dateType = dateType;
}
public List getOrgData() {
return orgData;
}
public void setOrgData(List orgData) {
putBodyParameter("orgData", orgData);
this.orgData = orgData;
}
public List getDeviceCode() {
return deviceCode;
}
public void setDeviceCode(List deviceCode) {
putBodyParameter("deviceCode",deviceCode);
this.deviceCode = deviceCode;
}
public List getChannelId() {
return channelId;
}
public void setChannelId(List channelId) {
putBodyParameter("channelId",channelId);
this.channelId = channelId;
}
public String getDate() {
return date;
}
public void setDate(String date) {
putBodyParameter("date",date);
this.date = date;
}
public String getAirSwitchType() {
return airSwitchType;
}
public void setAirSwitchType(String airSwitchType) {
putBodyParameter("airSwitchType",airSwitchType);
this.airSwitchType = airSwitchType;
}
public EnergyCountRequest() throws ClientException {
super(ElectricityConstant.url(ElectricityConstant.ENERGY_COUNT), Method.POST);
}
public EnergyCountRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
super(httpConfigInfo.getPrefixUrl() + url, method, Boolean.TRUE);
}
@Override
public Class getResponseClass() {
return EnergyCountResponse.class;
}
public void businessValid() {
if (orgType==null) {
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "orgType");
}
if (dateType==null) {
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "dateType");
}
if (orgData ==null) {
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "orgDate");
}
// if (StringUtils.isEmpty(airSwitchType)) {
// throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "airSwitchType");
// }
if (StringUtils.isEmpty(date)) {
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "date");
}
}
}