com.dahuatech.icc.cirs.model.v202209.device.DeviceBatchOperateRequest Maven / Gradle / Ivy
The newest version!
package com.dahuatech.icc.cirs.model.v202209.device;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.cirs.constant.CirsConstant;
import com.dahuatech.icc.cirs.enums.BatchTypeEnums;
import com.dahuatech.icc.common.ParamValidEnum;
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.CollectionUtil;
import java.util.List;
/**
* program:java-sdk
*
* @Author: 355079
* @Date:2022-09-07 14:19
* @Description:
*/
public class DeviceBatchOperateRequest extends AbstractIccRequest {
private Integer batchType;
private List deviceIds;
private Boolean crossDayStatus;
private OnOffDevicestrategy onOffDevicestrategy;
private OnOffScreenstrategy onOffScreenstrategy;
private VolumeInfo volumeInfo;
public class OnOffDevicestrategy{
private Boolean customStatus;
private List deviceCustom;
private Week week;
private Boolean weekStatus;
private Boolean crossDayStatus;
private List crossDay;
public class CrossDay{
private String turnOnTime;
private String turnOffTime;
public String getTurnOnTime() {
return turnOnTime;
}
public void setTurnOnTime(String turnOnTime) {
this.turnOnTime = turnOnTime;
}
public String getTurnOffTime() {
return turnOffTime;
}
public void setTurnOffTime(String turnOffTime) {
this.turnOffTime = turnOffTime;
}
}
public class Custom{
private String turnOnTime;
private String turnOffTime;
}
public class Week{
private String day;
private String turnOnOffTime;
}
public Boolean getCustomStatus() {
return customStatus;
}
public void setCustomStatus(Boolean customStatus) {
this.customStatus = customStatus;
}
public List getDeviceCustom() {
return deviceCustom;
}
public void setDeviceCustom(List deviceCustom) {
this.deviceCustom = deviceCustom;
}
public Week getWeek() {
return week;
}
public void setWeek(Week week) {
this.week = week;
}
public Boolean getWeekStatus() {
return weekStatus;
}
public void setWeekStatus(Boolean weekStatus) {
this.weekStatus = weekStatus;
}
public Boolean getCrossDayStatus() {
return crossDayStatus;
}
public void setCrossDayStatus(Boolean crossDayStatus) {
this.crossDayStatus = crossDayStatus;
}
public List getCrossDay() {
return crossDay;
}
public void setCrossDay(List crossDay) {
this.crossDay = crossDay;
}
}
public class OnOffScreenstrategy{
private Custom custom;
private Boolean customStatus;
private Week week;
private List crossDay;
private Boolean crossDayStatus;
public class Custom{
private String openScreenTime;
private String closeScreenTime;
public String getOpenScreenTime() {
return openScreenTime;
}
public void setOpenScreenTime(String openScreenTime) {
this.openScreenTime = openScreenTime;
}
public String getCloseScreenTime() {
return closeScreenTime;
}
public void setCloseScreenTime(String closeScreenTime) {
this.closeScreenTime = closeScreenTime;
}
}
public class Week{
private String day;
private String openCloseScreenTime;
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
public String getOpenCloseScreenTime() {
return openCloseScreenTime;
}
public void setOpenCloseScreenTime(String openCloseScreenTime) {
this.openCloseScreenTime = openCloseScreenTime;
}
}
public class CrossDay{
private String openCloseScreenTime;
private String closeScreenTime;
public String getOpenCloseScreenTime() {
return openCloseScreenTime;
}
public void setOpenCloseScreenTime(String openCloseScreenTime) {
this.openCloseScreenTime = openCloseScreenTime;
}
public String getCloseScreenTime() {
return closeScreenTime;
}
public void setCloseScreenTime(String closeScreenTime) {
this.closeScreenTime = closeScreenTime;
}
}
public Custom getCustom() {
return custom;
}
public void setCustom(Custom custom) {
this.custom = custom;
}
public Boolean getCustomStatus() {
return customStatus;
}
public void setCustomStatus(Boolean customStatus) {
this.customStatus = customStatus;
}
public Week getWeek() {
return week;
}
public void setWeek(Week week) {
this.week = week;
}
public List getCrossDay() {
return crossDay;
}
public void setCrossDay(List crossDay) {
this.crossDay = crossDay;
}
public Boolean getCrossDayStatus() {
return crossDayStatus;
}
public void setCrossDayStatus(Boolean crossDayStatus) {
this.crossDayStatus = crossDayStatus;
}
}
public class VolumeInfo{
private String beginTime;
private String endTime;
private String volume;
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getVolume() {
return volume;
}
public void setVolume(String volume) {
this.volume = volume;
}
}
public Integer getBatchType() {
return batchType;
}
public void setBatchType(Integer batchType) {
putBodyParameter("batchType",batchType);
this.batchType = batchType;
}
public List getDeviceIds() {
return deviceIds;
}
public void setDeviceIds(List deviceIds) {
putBodyParameter("deviceIds",deviceIds);
this.deviceIds = deviceIds;
}
public Boolean getCrossDayStatus() {
return crossDayStatus;
}
public void setCrossDayStatus(Boolean crossDayStatus) {
putBodyParameter("crossDayStatus",crossDayStatus);
this.crossDayStatus = crossDayStatus;
}
public OnOffDevicestrategy getOnOffDevicestrategy() {
return onOffDevicestrategy;
}
public void setOnOffDevicestrategy(OnOffDevicestrategy onOffDevicestrategy) {
putBodyParameter("onOffDevicestrategy",onOffDevicestrategy);
this.onOffDevicestrategy = onOffDevicestrategy;
}
public OnOffScreenstrategy getOnOffScreenstrategy() {
return onOffScreenstrategy;
}
public void setOnOffScreenstrategy(OnOffScreenstrategy onOffScreenstrategy) {
putBodyParameter("onOffScreenstrategy",onOffScreenstrategy);
this.onOffScreenstrategy = onOffScreenstrategy;
}
public VolumeInfo getVolumeInfo() {
return volumeInfo;
}
public void setVolumeInfo(VolumeInfo volumeInfo) {
putBodyParameter("volumeInfo",volumeInfo);
this.volumeInfo = volumeInfo;
}
public DeviceBatchOperateRequest() throws ClientException {
super(CirsConstant.url(CirsConstant.DEVICE_BATCH_OPERATE), Method.POST);
}
public DeviceBatchOperateRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
super(httpConfigInfo.getPrefixUrl() + url, method, Boolean.TRUE);
}
@Override
public Class getResponseClass() {
return DeviceBatchOperateResponse.class;
}
public void businessValid() {
if(!BatchTypeEnums.isRight(batchType)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "batchType");
}
if(CollectionUtil.isEmpty(deviceIds)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "deviceIds");
}
if(batchType==1&&onOffScreenstrategy==null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "onOffScreenstrategy");
}
if(batchType==2&&onOffDevicestrategy==null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "onOffDevicestrategy");
}
if(batchType==3&&volumeInfo==null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "volumeInfo");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy