com.dahuatech.icc.multiinone.admin.vo.AlarmPlayBackRequest Maven / Gradle / Ivy
package com.dahuatech.icc.multiinone.admin.vo;
import com.dahuatech.icc.admin.enums.PlayBackFormatEnum;
import com.dahuatech.icc.common.ParamValidEnum;
import com.dahuatech.icc.multiinone.exception.BusinessException;
import com.dahuatech.icc.multiinone.utils.StringUtils;
import com.dahuatech.icc.multiinone.vo.BaseRequest;
/**
* 报警录像录像请求报文
*/
public class AlarmPlayBackRequest extends BaseRequest {
private String type;//hls,flv,rtmp,rtsp 拉流格式
private String alarmCode;//报警编码
private String clientType;
private String clientMac;
private String clientPushId;
private String project;
private String method;
private AlarmInfo data;
public String getClientType() {
return clientType;
}
public void setClientType(String clientType) {
this.clientType = clientType;
}
public String getClientMac() {
return clientMac;
}
public void setClientMac(String clientMac) {
this.clientMac = clientMac;
}
public String getClientPushId() {
return clientPushId;
}
public void setClientPushId(String clientPushId) {
this.clientPushId = clientPushId;
}
public String getProject() {
return project;
}
public void setProject(String project) {
this.project = project;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public AlarmInfo getData() {
return data;
}
public void setData(AlarmInfo data) {
this.data = data;
}
public void businessValid() {
alarmCode=this.getData().getAlarmCode();
if(!PlayBackFormatEnum.isRight(type)){
throw new BusinessException(ParamValidEnum.PARAM_FORMAT_ERROR.getCode(),"播放格式非法");
}
if(StringUtils.isEmpty(this.alarmCode)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),"通道编码非法");
}
if(StringUtils.isEmpty(clientType)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),"客户端类型不能为空");
}
if(StringUtils.isEmpty(clientMac)){
throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),"电脑MAC不能为空");
}
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getAlarmCode() {
return alarmCode;
}
public void setAlarmCode(String alarmCode) {
this.alarmCode = alarmCode;
}
}