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

com.dahuatech.icc.pmms.model.v202207.data.RealDataRequest Maven / Gradle / Ivy

There is a newer version: 1.0.13.10
Show newest version
package com.dahuatech.icc.pmms.model.v202207.data;

import com.dahuatech.hutool.http.Method;
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;
import com.dahuatech.icc.pmms.constant.PmmsConstant;
import com.dahuatech.icc.util.StringUtils;

/**
 * program:java-sdk
 *
 * Author: 355079
 * Date:2022-08-17 10:59
 * Description: 分页查询实时数据信息
 */
public class RealDataRequest extends AbstractIccRequest {
    private String nodeId;
    private String devChildType;
    private Integer pageNo;
    private Integer pageSize;

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getDevChildType() {
        return devChildType;
    }

    public void setDevChildType(String devChildType) {
        this.devChildType = devChildType;
    }

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public RealDataRequest() throws ClientException {
        super(PmmsConstant.url(PmmsConstant.REAL_DATA,null), Method.GET);
    }

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

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

    public void businessValid() {
        if(StringUtils.isEmpty(nodeId)){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "nodeId");
        }
        if(StringUtils.isEmpty(devChildType)){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "devChildType");
        }
        if(pageSize==null){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "pageSize");
        }
        if(pageNo==null){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "pageNo");
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy