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

com.dahuatech.icc.pmms.model.v202207.device.DeviceStatisticsStatusRequest Maven / Gradle / Ivy

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

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 13:56
 * Description:
 */
public class DeviceStatisticsStatusRequest extends AbstractIccRequest {
    private String nodeId;
    private String moduleCode;

    public String getNodeId() {
        return nodeId;
    }

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

    public String getModuleCode() {
        return moduleCode;
    }

    public void setModuleCode(String moduleCode) {
        this.moduleCode = moduleCode;
    }

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

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

    @Override
    public Class getResponseClass() {
        return DeviceStatisticsStatusResponse.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(moduleCode)){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "moduleCode");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy