All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dahuatech.icc.assesscontrol.model.v202103.channelControl.ChannelControlCloseDoorRequest Maven / Gradle / Ivy

There is a newer version: 1.0.13.10
Show newest version
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 ChannelControlCloseDoorRequest extends AbstractIccRequest {

    /** 门通道编码 */
    private List channelCodeList;

    public ChannelControlCloseDoorRequest(Builder builder) throws ClientException {
        super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_CLOSE_DOOR_POST), Method.POST);
        this.channelCodeList = builder.channelCodeList;
        putBodyParameter("channelCodeList",channelCodeList);
    }

    public ChannelControlCloseDoorRequest(){
        super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_CLOSE_DOOR_POST), Method.POST);
    }

    public static Builder builder() {
        return new Builder();
    }

    @Override
    public Class getResponseClass() {
        return ChannelControlCloseDoorResponse.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 ChannelControlCloseDoorRequest build() throws ClientException {
            return new ChannelControlCloseDoorRequest(this);
        }
    }
    public void businessValid() {
        if(CollectionUtil.isEmpty(channelCodeList)){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "channelCodeList");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy