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

com.dahuatech.icc.face.model.v202207.deptGroup.DeptGroupSyncRequest Maven / Gradle / Ivy

The newest version!
package com.dahuatech.icc.face.model.v202207.deptGroup;

import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.common.ParamValidEnum;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.face.constant.FaceConstant;
import com.dahuatech.icc.oauth.exception.BusinessException;
import com.dahuatech.icc.oauth.http.AbstractIccRequest;
import com.dahuatech.icc.oauth.model.v202010.HttpConfigInfo;

import java.util.List;

/**
 * program:java-sdk
 *
 * Author: 312013
 * Date:2022-07-26 16:32
 * Description: 人像绑定
 */
public class DeptGroupSyncRequest extends AbstractIccRequest {
    private Long deptId;
    private List groupIdList;
    private boolean cascade;

    public Long getDeptId() {
        return deptId;
    }

    public void setDeptId(Long deptId) {
        putBodyParameter("deptId",deptId);
        this.deptId = deptId;
    }

    public List getGroupIdList() {
        return groupIdList;
    }

    public void setGroupIdList(List groupIdList) {
        putBodyParameter("groupIdList",groupIdList);
        this.groupIdList = groupIdList;
    }

    public boolean isCascade() {
        return cascade;
    }

    public void setCascade(boolean cascade) {
        putBodyParameter("cascade",cascade);
        this.cascade = cascade;
    }

    public DeptGroupSyncRequest() {
        super(FaceConstant.url(FaceConstant.DEPT_GROUP_SYNC), Method.POST);
    }

    public DeptGroupSyncRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
        super(httpConfigInfo.getPrefixUrl() + url,method,Boolean.TRUE);
    }

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

    public void businessValid() {
        if(deptId == null){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "deptId");
        }
        if(cascade != true && cascade != false){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "cascade");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy