From c5ff8113780960c55de98c0b9f3b1f895dd828e2 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期三, 08 三月 2023 13:28:54 +0800
Subject: [PATCH] 优化兼容接口

---
 src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java     |    6 
 src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtent.java |  577 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 577 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
index 5065523..57c7979 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiDeviceController.java
@@ -109,12 +109,6 @@
 //        }
         JSONObject result = new JSONObject();
         // 鏌ヨ璁惧鏄惁瀛樺湪
-        Device device = storager.queryVideoDevice(serial);
-        if (device == null) {
-            result.put("ChannelCount", 0);
-            result.put("ChannelList", "[]");
-            return result;
-        }
         List<DeviceChannel> deviceChannels;
         List<String> channelIds = null;
         if (!StringUtils.isEmpty(code)) {
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtent.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtent.java
new file mode 100644
index 0000000..9494352
--- /dev/null
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/dto/DeviceChannelExtent.java
@@ -0,0 +1,577 @@
+package com.genersoft.iot.vmp.web.gb28181.dto;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+
+@Schema(description = "閫氶亾淇℃伅")
+public class DeviceChannelExtent {
+
+
+	/**
+	 * 鏁版嵁搴撹嚜澧濱D
+	 */
+	@Schema(description = "鏁版嵁搴撹嚜澧濱D")
+	private int id;
+
+	/**
+	 * 閫氶亾鍥芥爣缂栧彿
+	 */
+	@Schema(description = "閫氶亾鍥芥爣缂栧彿")
+	private String channelId;
+
+	/**
+	 * 璁惧鍥芥爣缂栧彿
+	 */
+	@Schema(description = "璁惧鍥芥爣缂栧彿")
+	private String deviceId;
+	
+	/**
+	 * 閫氶亾鍚�
+	 */
+	@Schema(description = "鍚嶇О")
+	private String name;
+	
+	/**
+	 * 鐢熶骇鍘傚晢
+	 */
+	@Schema(description = "鐢熶骇鍘傚晢")
+	private String manufacture;
+	
+	/**
+	 * 鍨嬪彿
+	 */
+	@Schema(description = "鍨嬪彿")
+	private String model;
+	
+	/**
+	 * 璁惧褰掑睘
+	 */
+	@Schema(description = "璁惧褰掑睘")
+	private String owner;
+	
+	/**
+	 * 琛屾斂鍖哄煙
+	 */
+	@Schema(description = "琛屾斂鍖哄煙")
+	private String civilCode;
+	
+	/**
+	 * 璀﹀尯
+	 */
+	@Schema(description = "璀﹀尯")
+	private String block;
+
+	/**
+	 * 瀹夎鍦板潃
+	 */
+	@Schema(description = "瀹夎鍦板潃")
+	private String address;
+	
+	/**
+	 * 鏄惁鏈夊瓙璁惧 1鏈�, 0娌℃湁
+	 */
+	@Schema(description = "鏄惁鏈夊瓙璁惧 1鏈�, 0娌℃湁")
+	private int parental;
+	
+	/**
+	 * 鐖剁骇id
+	 */
+	@Schema(description = "鐖剁骇id")
+	private String parentId;
+	
+	/**
+	 * 淇′护瀹夊叏妯″紡  缂虹渷涓�0; 0:涓嶉噰鐢�; 2: S/MIME绛惧悕鏂瑰紡; 3: S/ MIME鍔犲瘑绛惧悕鍚屾椂閲囩敤鏂瑰紡; 4:鏁板瓧鎽樿鏂瑰紡
+	 */
+	@Schema(description = "淇′护瀹夊叏妯″紡  缂虹渷涓�0; 0:涓嶉噰鐢�; 2: S/MIME绛惧悕鏂瑰紡; 3: S/ MIME鍔犲瘑绛惧悕鍚屾椂閲囩敤鏂瑰紡; 4:鏁板瓧鎽樿鏂瑰紡")
+	private int safetyWay;
+	
+	/**
+	 * 娉ㄥ唽鏂瑰紡 缂虹渷涓�1;1:绗﹀悎IETFRFC3261鏍囧噯鐨勮璇佹敞鍐屾ā 寮�; 2:鍩轰簬鍙d护鐨勫弻鍚戣璇佹敞鍐屾ā寮�; 3:鍩轰簬鏁板瓧璇佷功鐨勫弻鍚戣璇佹敞鍐屾ā寮�
+	 */
+	@Schema(description = "娉ㄥ唽鏂瑰紡 缂虹渷涓�1;1:绗﹀悎IETFRFC3261鏍囧噯鐨勮璇佹敞鍐屾ā 寮�; 2:鍩轰簬鍙d护鐨勫弻鍚戣璇佹敞鍐屾ā寮�; 3:鍩轰簬鏁板瓧璇佷功鐨勫弻鍚戣璇佹敞鍐屾ā寮�")
+	private int registerWay;
+	
+	/**
+	 * 璇佷功搴忓垪鍙�
+	 */
+	@Schema(description = "璇佷功搴忓垪鍙�")
+	private String certNum;
+	
+	/**
+	 * 璇佷功鏈夋晥鏍囪瘑 缂虹渷涓�0;璇佷功鏈夋晥鏍囪瘑:0:鏃犳晥1: 鏈夋晥
+	 */
+	@Schema(description = "璇佷功鏈夋晥鏍囪瘑 缂虹渷涓�0;璇佷功鏈夋晥鏍囪瘑:0:鏃犳晥1: 鏈夋晥")
+	private int certifiable;
+	
+	/**
+	 * 璇佷功鏃犳晥鍘熷洜鐮�
+	 */
+	@Schema(description = "璇佷功鏃犳晥鍘熷洜鐮�")
+	private int errCode;
+	
+	/**
+	 * 璇佷功缁堟鏈夋晥鏈�
+	 */
+	@Schema(description = "璇佷功缁堟鏈夋晥鏈�")
+	private String endTime;
+	
+	/**
+	 * 淇濆瘑灞炴�� 缂虹渷涓�0; 0:涓嶆秹瀵�, 1:娑夊瘑
+	 */
+	@Schema(description = "淇濆瘑灞炴�� 缂虹渷涓�0; 0:涓嶆秹瀵�, 1:娑夊瘑")
+	private String secrecy;
+	
+	/**
+	 * IP鍦板潃
+	 */
+	@Schema(description = "IP鍦板潃")
+	private String ipAddress;
+	
+	/**
+	 * 绔彛鍙�
+	 */
+	@Schema(description = "绔彛鍙�")
+	private int port;
+	
+	/**
+	 * 瀵嗙爜
+	 */
+	@Schema(description = "瀵嗙爜")
+	private String password;
+
+	/**
+	 * 浜戝彴绫诲瀷
+	 */
+	@Schema(description = "浜戝彴绫诲瀷")
+	private int PTZType;
+
+	/**
+	 * 浜戝彴绫诲瀷鎻忚堪瀛楃涓�
+	 */
+	@Schema(description = "浜戝彴绫诲瀷鎻忚堪瀛楃涓�")
+	private String PTZTypeText;
+
+	/**
+	 * 鍒涘缓鏃堕棿
+	 */
+	@Schema(description = "鍒涘缓鏃堕棿")
+	private String createTime;
+
+	/**
+	 * 鏇存柊鏃堕棿
+	 */
+	@Schema(description = "鏇存柊鏃堕棿")
+	private String updateTime;
+	
+	/**
+	 * 鍦ㄧ嚎/绂荤嚎
+	 * 1鍦ㄧ嚎,0绂荤嚎
+	 * 榛樿鍦ㄧ嚎
+	 * 淇′护:
+	 * <Status>ON</Status>
+	 * <Status>OFF</Status>
+	 * 閬囧埌杩嘚VR涓嬬殑IPC涓嬪彂淇′护鍙互鎺ㄦ祦锛� 浣嗘槸 Status 鍝嶅簲 OFF
+	 */
+	@Schema(description = "鍦ㄧ嚎/绂荤嚎锛� 1鍦ㄧ嚎,0绂荤嚎")
+	private int status;
+
+	/**
+	 * 缁忓害
+	 */
+	@Schema(description = "缁忓害")
+	private double longitude;
+	
+	/**
+	 * 绾害
+	 */
+	@Schema(description = "绾害")
+	private double latitude;
+
+	/**
+	 * 缁忓害 GCJ02
+	 */
+	@Schema(description = "GCJ02鍧愭爣绯荤粡搴�")
+	private double longitudeGcj02;
+
+	/**
+	 * 绾害 GCJ02
+	 */
+	@Schema(description = "GCJ02鍧愭爣绯荤含搴�")
+	private double latitudeGcj02;
+
+	/**
+	 * 缁忓害 WGS84
+	 */
+	@Schema(description = "WGS84鍧愭爣绯荤粡搴�")
+	private double longitudeWgs84;
+
+	/**
+	 * 绾害 WGS84
+	 */
+	@Schema(description = "WGS84鍧愭爣绯荤含搴�")
+	private double latitudeWgs84;
+
+	/**
+	 * 瀛愯澶囨暟
+	 */
+	@Schema(description = "瀛愯澶囨暟")
+	private int subCount;
+
+	/**
+	 * 娴佸敮涓�缂栧彿锛屽瓨鍦ㄨ〃绀烘鍦ㄧ洿鎾�
+	 */
+	@Schema(description = "娴佸敮涓�缂栧彿锛屽瓨鍦ㄨ〃绀烘鍦ㄧ洿鎾�")
+	private String  streamId;
+
+	/**
+	 *  鏄惁鍚湁闊抽
+	 */
+	@Schema(description = "鏄惁鍚湁闊抽")
+	private boolean hasAudio;
+
+	/**
+	 * 鏍囪閫氶亾鐨勭被鍨嬶紝0->鍥芥爣閫氶亾 1->鐩存挱娴侀�氶亾 2->涓氬姟鍒嗙粍/铏氭嫙缁勭粐/琛屾斂鍖哄垝
+	 */
+	@Schema(description = "鏍囪閫氶亾鐨勭被鍨嬶紝0->鍥芥爣閫氶亾 1->鐩存挱娴侀�氶亾 2->涓氬姟鍒嗙粍/铏氭嫙缁勭粐/琛屾斂鍖哄垝")
+	private int channelType;
+
+	/**
+	 * 涓氬姟鍒嗙粍
+	 */
+	@Schema(description = "涓氬姟鍒嗙粍")
+	private String businessGroupId;
+
+	/**
+	 * GPS鐨勬洿鏂版椂闂�
+	 */
+	@Schema(description = "GPS鐨勬洿鏂版椂闂�")
+	private String gpsTime;
+
+	public int getId() {
+		return id;
+	}
+
+	public void setId(int id) {
+		this.id = id;
+	}
+
+	public String getDeviceId() {
+		return deviceId;
+	}
+
+	public void setDeviceId(String deviceId) {
+		this.deviceId = deviceId;
+	}
+
+	public void setPTZType(int PTZType) {
+		this.PTZType = PTZType;
+		switch (PTZType) {
+			case 0:
+				this.PTZTypeText = "鏈煡";
+				break;
+			case 1:
+				this.PTZTypeText = "鐞冩満";
+				break;
+			case 2:
+				this.PTZTypeText = "鍗婄悆";
+				break;
+			case 3:
+				this.PTZTypeText = "鍥哄畾鏋満";
+				break;
+			case 4:
+				this.PTZTypeText = "閬ユ帶鏋満";
+				break;
+		}
+	}
+
+	public String getChannelId() {
+		return channelId;
+	}
+
+	public void setChannelId(String channelId) {
+		this.channelId = channelId;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getManufacture() {
+		return manufacture;
+	}
+
+	public void setManufacture(String manufacture) {
+		this.manufacture = manufacture;
+	}
+
+	public String getModel() {
+		return model;
+	}
+
+	public void setModel(String model) {
+		this.model = model;
+	}
+
+	public String getOwner() {
+		return owner;
+	}
+
+	public void setOwner(String owner) {
+		this.owner = owner;
+	}
+
+	public String getCivilCode() {
+		return civilCode;
+	}
+
+	public void setCivilCode(String civilCode) {
+		this.civilCode = civilCode;
+	}
+
+	public String getBlock() {
+		return block;
+	}
+
+	public void setBlock(String block) {
+		this.block = block;
+	}
+
+	public String getAddress() {
+		return address;
+	}
+
+	public void setAddress(String address) {
+		this.address = address;
+	}
+
+	public int getParental() {
+		return parental;
+	}
+
+	public void setParental(int parental) {
+		this.parental = parental;
+	}
+
+	public String getParentId() {
+		return parentId;
+	}
+
+	public void setParentId(String parentId) {
+		this.parentId = parentId;
+	}
+
+	public int getSafetyWay() {
+		return safetyWay;
+	}
+
+	public void setSafetyWay(int safetyWay) {
+		this.safetyWay = safetyWay;
+	}
+
+	public int getRegisterWay() {
+		return registerWay;
+	}
+
+	public void setRegisterWay(int registerWay) {
+		this.registerWay = registerWay;
+	}
+
+	public String getCertNum() {
+		return certNum;
+	}
+
+	public void setCertNum(String certNum) {
+		this.certNum = certNum;
+	}
+
+	public int getCertifiable() {
+		return certifiable;
+	}
+
+	public void setCertifiable(int certifiable) {
+		this.certifiable = certifiable;
+	}
+
+	public int getErrCode() {
+		return errCode;
+	}
+
+	public void setErrCode(int errCode) {
+		this.errCode = errCode;
+	}
+
+	public String getEndTime() {
+		return endTime;
+	}
+
+	public void setEndTime(String endTime) {
+		this.endTime = endTime;
+	}
+
+	public String getSecrecy() {
+		return secrecy;
+	}
+
+	public void setSecrecy(String secrecy) {
+		this.secrecy = secrecy;
+	}
+
+	public String getIpAddress() {
+		return ipAddress;
+	}
+
+	public void setIpAddress(String ipAddress) {
+		this.ipAddress = ipAddress;
+	}
+
+	public int getPort() {
+		return port;
+	}
+
+	public void setPort(int port) {
+		this.port = port;
+	}
+
+	public String getPassword() {
+		return password;
+	}
+
+	public void setPassword(String password) {
+		this.password = password;
+	}
+
+	public int getPTZType() {
+		return PTZType;
+	}
+
+	public String getPTZTypeText() {
+		return PTZTypeText;
+	}
+
+	public void setPTZTypeText(String PTZTypeText) {
+		this.PTZTypeText = PTZTypeText;
+	}
+
+	public int getStatus() {
+		return status;
+	}
+
+	public void setStatus(int status) {
+		this.status = status;
+	}
+
+	public double getLongitude() {
+		return longitude;
+	}
+
+	public void setLongitude(double longitude) {
+		this.longitude = longitude;
+	}
+
+	public double getLatitude() {
+		return latitude;
+	}
+
+	public void setLatitude(double latitude) {
+		this.latitude = latitude;
+	}
+
+	public double getLongitudeGcj02() {
+		return longitudeGcj02;
+	}
+
+	public void setLongitudeGcj02(double longitudeGcj02) {
+		this.longitudeGcj02 = longitudeGcj02;
+	}
+
+	public double getLatitudeGcj02() {
+		return latitudeGcj02;
+	}
+
+	public void setLatitudeGcj02(double latitudeGcj02) {
+		this.latitudeGcj02 = latitudeGcj02;
+	}
+
+	public double getLongitudeWgs84() {
+		return longitudeWgs84;
+	}
+
+	public void setLongitudeWgs84(double longitudeWgs84) {
+		this.longitudeWgs84 = longitudeWgs84;
+	}
+
+	public double getLatitudeWgs84() {
+		return latitudeWgs84;
+	}
+
+	public void setLatitudeWgs84(double latitudeWgs84) {
+		this.latitudeWgs84 = latitudeWgs84;
+	}
+
+	public int getSubCount() {
+		return subCount;
+	}
+
+	public void setSubCount(int subCount) {
+		this.subCount = subCount;
+	}
+
+	public boolean isHasAudio() {
+		return hasAudio;
+	}
+
+	public void setHasAudio(boolean hasAudio) {
+		this.hasAudio = hasAudio;
+	}
+
+	public String getStreamId() {
+		return streamId;
+	}
+
+	public void setStreamId(String streamId) {
+		this.streamId = streamId;
+	}
+
+	public String getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getUpdateTime() {
+		return updateTime;
+	}
+
+	public void setUpdateTime(String updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public int getChannelType() {
+		return channelType;
+	}
+
+	public void setChannelType(int channelType) {
+		this.channelType = channelType;
+	}
+
+	public String getBusinessGroupId() {
+		return businessGroupId;
+	}
+
+	public void setBusinessGroupId(String businessGroupId) {
+		this.businessGroupId = businessGroupId;
+	}
+
+	public String getGpsTime() {
+		return gpsTime;
+	}
+
+	public void setGpsTime(String gpsTime) {
+		this.gpsTime = gpsTime;
+	}
+}

--
Gitblit v1.8.0