com.dahuatech.icc.face.model.v202207.groupInfo.GroupInfoAddRequest Maven / Gradle / Ivy
The newest version!
package com.dahuatech.icc.face.model.v202207.groupInfo;
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 com.dahuatech.icc.util.CollectionUtil;
import com.dahuatech.icc.util.StringUtils;
import java.util.List;
/**
* program:java-sdk
*
* Author: 312013
* Date:2022-07-25 14:31
* Description: 人像库新增
*/
public class GroupInfoAddRequest extends AbstractIccRequest {
private String groupdetail;
private String groupname;
private Integer grouptype;
private List deviceCodeList;
public String getGroupdetail() {
return groupdetail;
}
public void setGroupdetail(String groupdetail) {
putBodyParameter("groupdetail",groupdetail);
this.groupdetail = groupdetail;
}
public String getGroupname() {
return groupname;
}
public void setGroupname(String groupname) {
putBodyParameter("groupname",groupname);
this.groupname = groupname;
}
public Integer getGrouptype() {
return grouptype;
}
public void setGrouptype(Integer grouptype) {
putBodyParameter("grouptype",grouptype);
this.grouptype = grouptype;
}
public List getDeviceCodeList() {
return deviceCodeList;
}
public void setDeviceCodeList(List deviceCodeList) {
putBodyParameter("deviceCodeList",deviceCodeList);
this.deviceCodeList = deviceCodeList;
}
public GroupInfoAddRequest() throws ClientException {
super(FaceConstant.url(FaceConstant.ADD_GROUP_INFO), Method.POST);
}
public GroupInfoAddRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
super(httpConfigInfo.getPrefixUrl() + url,method,Boolean.TRUE);
}
@Override
public Class getResponseClass() {
return GroupInfoAddResponse.class;
}
public void businessValid() {
if(StringUtils.isEmpty(groupdetail)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "groupdetail");
}
if(StringUtils.isEmpty(groupname)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "groupname");
}
if(grouptype == null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "grouptype");
}
if(CollectionUtil.isEmpty(deviceCodeList)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "deviceCodeList");
}
}
}