recordInfo 格式修正
This commit is contained in:
parent
3e11b95ac6
commit
b58053f20b
@ -7,6 +7,7 @@ import cn.skcks.docking.gb28181.common.xml.XmlUtils;
|
|||||||
import cn.skcks.docking.gb28181.core.sip.message.processor.message.types.recordinfo.query.dto.RecordInfoRequestDTO;
|
import cn.skcks.docking.gb28181.core.sip.message.processor.message.types.recordinfo.query.dto.RecordInfoRequestDTO;
|
||||||
import cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto.RecordInfoItemDTO;
|
import cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto.RecordInfoItemDTO;
|
||||||
import cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto.RecordInfoResponseDTO;
|
import cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto.RecordInfoResponseDTO;
|
||||||
|
import cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto.RecordListDTO;
|
||||||
import cn.skcks.docking.gb28181.mocking.core.sip.request.SipRequestBuilder;
|
import cn.skcks.docking.gb28181.mocking.core.sip.request.SipRequestBuilder;
|
||||||
import cn.skcks.docking.gb28181.mocking.core.sip.response.SipResponseBuilder;
|
import cn.skcks.docking.gb28181.mocking.core.sip.response.SipResponseBuilder;
|
||||||
import cn.skcks.docking.gb28181.mocking.core.sip.sender.SipSender;
|
import cn.skcks.docking.gb28181.mocking.core.sip.sender.SipSender;
|
||||||
@ -88,7 +89,11 @@ public class RecordInfoRequestProcessor {
|
|||||||
recordInfoResponseDTO.setDeviceId(device.getGbChannelId());
|
recordInfoResponseDTO.setDeviceId(device.getGbChannelId());
|
||||||
recordInfoResponseDTO.setName(device.getName());
|
recordInfoResponseDTO.setName(device.getName());
|
||||||
recordInfoResponseDTO.setSumNum((long) recordInfoItemDTOList.size());
|
recordInfoResponseDTO.setSumNum((long) recordInfoItemDTOList.size());
|
||||||
recordInfoResponseDTO.setRecordList(recordList);
|
RecordListDTO recordListDTO = RecordListDTO.builder()
|
||||||
|
.recordList(recordList)
|
||||||
|
.num(recordList.size())
|
||||||
|
.build();
|
||||||
|
recordInfoResponseDTO.setRecordList(recordListDTO);
|
||||||
|
|
||||||
sender.sendRequest((provider, ip, port) -> {
|
sender.sendRequest((provider, ip, port) -> {
|
||||||
CallIdHeader callIdHeader = provider.getNewCallId();
|
CallIdHeader callIdHeader = provider.getNewCallId();
|
||||||
|
@ -5,11 +5,16 @@ import cn.skcks.docking.gb28181.core.sip.gb28181.constant.GB28181Constant;
|
|||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||||
import jakarta.validation.constraints.Min;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@JacksonXmlRootElement(localName = "Item")
|
@JacksonXmlRootElement(localName = "Item")
|
||||||
public class RecordInfoItemDTO {
|
public class RecordInfoItemDTO {
|
||||||
@ -29,9 +34,10 @@ public class RecordInfoItemDTO {
|
|||||||
@JsonFormat(pattern = DatePattern.UTC_SIMPLE_PATTERN, timezone = GB28181Constant.TIME_ZONE)
|
@JsonFormat(pattern = DatePattern.UTC_SIMPLE_PATTERN, timezone = GB28181Constant.TIME_ZONE)
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
|
|
||||||
@Min(value = 0)
|
@Builder.Default
|
||||||
private Integer secrecy = 0;
|
private Integer secrecy = 0;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
private String type = "all";
|
private String type = "all";
|
||||||
|
|
||||||
private Long fileSize;
|
private Long fileSize;
|
||||||
|
@ -1,20 +1,23 @@
|
|||||||
package cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto;
|
package cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto;
|
||||||
|
|
||||||
import cn.skcks.docking.gb28181.core.sip.gb28181.constant.CmdType;
|
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.List;
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@JacksonXmlRootElement(localName = "Response")
|
@JacksonXmlRootElement(localName = "Response")
|
||||||
public class RecordInfoResponseDTO {
|
public class RecordInfoResponseDTO {
|
||||||
/**
|
/**
|
||||||
* 命令类型:设备信息查询(必选)
|
* 命令类型:设备信息查询(必选)
|
||||||
*/
|
*/
|
||||||
private String cmdType = CmdType.RECORD_INFO;
|
@Builder.Default
|
||||||
|
private String cmdType = "RecordInfo";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 命令序列号(必选)
|
* 命令序列号(必选)
|
||||||
@ -32,7 +35,5 @@ public class RecordInfoResponseDTO {
|
|||||||
|
|
||||||
private Long sumNum;
|
private Long sumNum;
|
||||||
|
|
||||||
@JacksonXmlElementWrapper(localName = "RecordList")
|
private RecordListDTO recordList;
|
||||||
@JacksonXmlProperty(localName = "Item")
|
|
||||||
private List<RecordInfoItemDTO> recordList;
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.skcks.docking.gb28181.mocking.core.sip.message.processor.message.request.recordinfo.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
|
||||||
|
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@JacksonXmlRootElement(localName = "RecordList")
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class RecordListDTO {
|
||||||
|
@Builder.Default
|
||||||
|
@JacksonXmlProperty(isAttribute = true)
|
||||||
|
private Integer num = 0;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
@JacksonXmlProperty(localName = "Item")
|
||||||
|
@JacksonXmlElementWrapper(useWrapping = false)
|
||||||
|
private List<RecordInfoItemDTO> recordList = new ArrayList<>();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user