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

com.dahuatech.icc.assesscontrol.model.v202103.firstCard.FirstCardDelRequest Maven / Gradle / Ivy

There is a newer version: 1.0.13.7
Show newest version
package com.dahuatech.icc.assesscontrol.model.v202103.firstCard;

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;

/**
 * 删除首卡
 *
 * @author 237417
 */
public class FirstCardDelRequest extends AbstractIccRequest {
    /** 首卡开门ID */
    private Long id;

    public FirstCardDelRequest(Builder builder) throws ClientException {
        super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_FIRST_CARD_DEL_POST), Method.POST);
        this.id = builder.id;
        putBodyParameter("id",id);
    }

    public FirstCardDelRequest(){
        super(AccessControlConstant.url(AccessControlConstant.ASSESS_CONTROL_URL_FIRST_CARD_DEL_POST), Method.POST);
    }

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

    @Override
    public Class getResponseClass() {
        return FirstCardDelResponse.class;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
        putBodyParameter("id",id);
    }

    public static class Builder {
        /** 首卡开门ID */
        private Long id;

        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public FirstCardDelRequest build() throws ClientException {
            return new FirstCardDelRequest(this);
        }
    }
    public void businessValid() {
        if(id == null){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "id");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy