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

com.dahuatech.icc.jpatrol.model.v202207.rule.RuleIdRequest Maven / Gradle / Ivy

package com.dahuatech.icc.jpatrol.model.v202207.rule;

import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.common.ParamValidEnum;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.jpatrol.constant.JpatrolConstant;
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-08-12 09:03
 * Description: 查询巡更计划详情
 */
public class RuleIdRequest extends AbstractIccRequest {
    private Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public RuleIdRequest(long id) throws ClientException {
        super(JpatrolConstant.url(JpatrolConstant.RULE_ID,id), Method.GET);
        this.id=id;
    }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy