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

com.dahuatech.icc.electricity.model.v202208.query.GetOtherDataRequest Maven / Gradle / Ivy

The newest version!
package com.dahuatech.icc.electricity.model.v202208.query;

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;

/**
 * program:java-sdk
 *
 * @Author: 355079
 * @Date:2022-08-22 09:58
 * @Description:
 */
public class GetOtherDataRequest extends AbstractIccRequest {
    private String airSwitchId;
    private String date;

    public String getAirSwitchId() {
        return airSwitchId;
    }

    public void setAirSwitchId(String airSwitchId) {
        putBodyParameter("airSwitchId",airSwitchId);
        this.airSwitchId = airSwitchId;
    }

    public String getDate() {
        return date;
    }

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

    public GetOtherDataRequest() throws ClientException {
        super(ElectricityConstant.url(ElectricityConstant.GET_OTHER_DATA), Method.POST);
    }

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

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

    public void businessValid() {
        if (StringUtils.isEmpty(airSwitchId)) {
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "airSwitchId");
        }
        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