com.dahuatech.icc.assesscontrol.model.v202103.channelControl.ChannelControlGetDoorStatusRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-accesscontrol Show documentation
Show all versions of java-sdk-accesscontrol Show documentation
Dahua ICC Open API SDK for Java
package com.dahuatech.icc.assesscontrol.model.v202103.channelControl;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.assesscontrol.constant.AccessControlConstant;
import com.dahuatech.icc.assesscontrol.constant.ParamConstant;
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.util.CollectionUtil;
import java.util.List;
/**
* 门通道控制获取门状态
*
* @author 237417
*/
public class ChannelControlGetDoorStatusRequest extends AbstractIccRequest {
/** 门通道编码 */
private List channelCodeList;
public ChannelControlGetDoorStatusRequest(Builder builder) {
super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_STAY_OPEN_POST), Method.POST);
this.channelCodeList = builder.channelCodeList;
putBodyParameter("channelCodeList",channelCodeList);
}
public ChannelControlGetDoorStatusRequest(){
super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_STAY_OPEN_POST), Method.POST);
}
public static Builder builder() {
return new Builder();
}
@Override
public Class getResponseClass() {
return ChannelControlGetDoorStatusResponse.class;
}
public List getChannelCodeList() {
return channelCodeList;
}
public void setChannelCodeList(List channelCodeList) {
this.channelCodeList = channelCodeList;
putBodyParameter("channelCodeList",channelCodeList);
}
public static class Builder {
/** 门通道编码 */
private List channelCodeList;
public Builder channelCodeList(List channelCodeList) {
this.channelCodeList = channelCodeList;
return this;
}
public ChannelControlGetDoorStatusRequest build() throws ClientException {
return new ChannelControlGetDoorStatusRequest(this);
}
}
public void businessValid() {
if(CollectionUtil.isEmpty(channelCodeList)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "channelCodeList");
}
}
}