com.dahuatech.icc.cirs.model.v202209.device.PageDeviceRequest Maven / Gradle / Ivy
The newest version!
package com.dahuatech.icc.cirs.model.v202209.device;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.cirs.constant.CirsConstant;
import com.dahuatech.icc.cirs.enums.DeviceStatusEnums;
import com.dahuatech.icc.cirs.enums.NodeTypeEnums;
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.oauth.model.v202010.HttpConfigInfo;
/**
* program:java-sdk
*
* @Author: 355079
* @Date:2022-09-07 10:18
* @Description: 查询设备列表
*/
public class PageDeviceRequest extends AbstractIccRequest {
private Integer pageNum;
private Integer pageSize;
private Integer type;
private Long id;
private String searchKey;
private String deviceStatus ;
private String order;
public Integer getPageNum() {
return pageNum;
}
public void setPageNum(Integer pageNum) {
putBodyParameter("pageNum",pageNum);
this.pageNum = pageNum;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
putBodyParameter("pageSize",pageSize);
this.pageSize = pageSize;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
putBodyParameter("type",type);
this.type = type;
}
public Long getId() {
return id;
}
public void setId(Long id) {
putBodyParameter("id",id);
this.id = id;
}
public String getSearchKey() {
return searchKey;
}
public void setSearchKey(String searchKey) {
putBodyParameter("searchKey",searchKey);
this.searchKey = searchKey;
}
public String getDeviceStatus() {
return deviceStatus;
}
public void setDeviceStatus(String deviceStatus) {
putBodyParameter("deviceStatus",deviceStatus);
this.deviceStatus = deviceStatus;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
putBodyParameter("order",order);
this.order = order;
}
public PageDeviceRequest() throws ClientException {
super(CirsConstant.url(CirsConstant.PAGE_DEVICES), Method.POST);
}
public PageDeviceRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
super(httpConfigInfo.getPrefixUrl() + url, method, Boolean.TRUE);
}
@Override
public Class getResponseClass() {
return PageDeviceResponse.class;
}
public void businessValid() {
if(pageNum==null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "pageNum");
}
if(pageSize==null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "pageSize");
}
if(type!=null){
if(!NodeTypeEnums.isRight(type)){
throw new BusinessException(ParamValidEnum.PARAM_SCOP_ERROR.getCode(), ParamValidEnum.PARAM_SCOP_ERROR.getErrMsg(), "type");
}
}
if(deviceStatus!=null){
if(!DeviceStatusEnums.isRight(deviceStatus)){
throw new BusinessException(ParamValidEnum.PARAM_SCOP_ERROR.getCode(), ParamValidEnum.PARAM_SCOP_ERROR.getErrMsg(), "deviceStatus");
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy