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

model.v202207.record.QueryRecordsRequest Maven / Gradle / Ivy

The newest version!
package model.v202207.record;

import com.dahuatech.hutool.http.Method;
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.util.StringUtils;
import contant.AdminConstant;
import enums.ParamEnum;
import model.v202207.talk.StartTalkResponse;

/**
 * program:java-sdk
 *
 * Author: 312013
 * Date:2022-07-21 18:50
 * Description: 查询录像信息
 */
public class QueryRecordsRequest extends AbstractIccRequest {

    public QueryRecordsRequest() {
        super(AdminConstant.ADMIN_QUERY_RECORDS, Method.POST);
    }

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

    private QueryRecordsData data;

    public QueryRecordsData getData() {
        return data;
    }

    public void setData(QueryRecordsData data) {
        this.data = data;
        putBodyParameter("data",data);
    }

    public class QueryRecordsData {
        private String channelId;
        private String recordSource;
        private String startTime;
        private String endTime;
        private String streamType;
        private String recordType;

        public String getChannelId() {
            return channelId;
        }

        public void setChannelId(String channelId) {
            this.channelId = channelId;
        }

        public String getRecordSource() {
            return recordSource;
        }

        public void setRecordSource(String recordSource) {
            this.recordSource = recordSource;
        }

        public String getStartTime() {
            return startTime;
        }

        public void setStartTime(String startTime) {
            this.startTime = startTime;
        }

        public String getEndTime() {
            return endTime;
        }

        public void setEndTime(String endTime) {
            this.endTime = endTime;
        }

        public String getStreamType() {
            return streamType;
        }

        public void setStreamType(String streamType) {
            this.streamType = streamType;
        }

        public String getRecordType() {
            return recordType;
        }

        public void setRecordType(String recordType) {
            this.recordType = recordType;
        }
    }

    public void businessValid() {
        if(data == null){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "data");
        }
        if(StringUtils.isEmpty(data.getChannelId())){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "channelId");
        }
        if(StringUtils.isEmpty(data.getRecordSource())){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "recordSource");
        }
        if(StringUtils.isEmpty(data.getStartTime())){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "startTime");
        }
        if(StringUtils.isEmpty(data.getEndTime())){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "endTime");
        }
        if(StringUtils.isEmpty(data.getStreamType())){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "streamType");
        }
        if(StringUtils.isEmpty(data.getRecordType())){
            throw new BusinessException(ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getCode(),ParamValidEnum.PARAM_NOT_EMPTY_ERROR.getErrMsg(), "recordType");
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy