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

com.dahuatech.icc.electricity.model.v202208.energy.EnergyCountAppRequest Maven / Gradle / Ivy

There is a newer version: 1.0.13.7
Show newest version
package com.dahuatech.icc.electricity.model.v202208.energy;

import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.common.ParamValidEnum;
import com.dahuatech.icc.electricity.constant.ElectricityConstant;
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.util.StringUtils;

import java.util.List;

/**
 * program:java-sdk
 *
 * @Author: 355079
 * @Date:2022-08-22 13:42
 * @Description:
 */
public class EnergyCountAppRequest extends AbstractIccRequest {
    private Integer dateType;
    private List orgData;
    private List deviceCode;
    private List channelId;
    private String date;

    public Integer getDateType() {
        return dateType;
    }

    public void setDateType(Integer dateType) {
        putBodyParameter("dateType",dateType);
        this.dateType = dateType;
    }

    public List getOrgData() {
        return orgData;
    }

    public void setOrgData(List orgData) {
        putBodyParameter("orgData", orgData);
        this.orgData = orgData;
    }

    public List getDeviceCode() {
        return deviceCode;
    }

    public void setDeviceCode(List deviceCode) {
        putBodyParameter("deviceCode",deviceCode);
        this.deviceCode = deviceCode;
    }

    public List getChannelId() {
        return channelId;
    }

    public void setChannelId(List channelId) {
        putBodyParameter("channelId",channelId);
        this.channelId = channelId;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        putBodyParameter("date",date);
        this.date = date;
    }


    public EnergyCountAppRequest() throws ClientException {
        super(ElectricityConstant.url(ElectricityConstant.ENERGY_COUNT_APP), Method.POST);
    }

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

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

    public void businessValid() {
        if (dateType==null) {
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "dateType");
        }
        if (StringUtils.isEmpty(date)) {
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "date");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy