com.dahuatech.icc.cirs.model.v202209.material.MaterialByIdRequest Maven / Gradle / Ivy
package com.dahuatech.icc.cirs.model.v202209.material;
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.cirs.constant.CirsConstant;
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;
/**
* program:java-sdk
*
* @Author: 355079
* @Date:2022-09-06 15:01
* @Description:
*/
public class MaterialByIdRequest extends AbstractIccRequest {
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public MaterialByIdRequest() throws ClientException {
super(CirsConstant.url(CirsConstant.MATERIAL_BY_ID), Method.GET);
}
public MaterialByIdRequest(HttpConfigInfo httpConfigInfo, String url, Method method) throws ClientException {
super(httpConfigInfo.getPrefixUrl() + url, method, Boolean.TRUE);
}
@Override
public Class getResponseClass() {
return MaterialByIdResponse.class;
}
public void businessValid() throws BusinessException {
if(id==null){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(), ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "id");
}
}
}