From 3e71e0bdf1e4b2e527d491d426f67e34b7d3c148 Mon Sep 17 00:00:00 2001
From: xiaoQQya <xiaoQQya@126.com>
Date: 星期六, 05 十一月 2022 11:35:01 +0800
Subject: [PATCH] perf(rtcPlayer): 修改控制台 log 级别
---
src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java
index 260047f..c817385 100644
--- a/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java
+++ b/src/main/java/com/genersoft/iot/vmp/web/gb28181/ApiControlController.java
@@ -1,13 +1,19 @@
package com.genersoft.iot.vmp.web.gb28181;
import com.alibaba.fastjson.JSONObject;
+import com.genersoft.iot.vmp.conf.exception.ControllerException;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
-import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
+import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
+import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+
+import javax.sip.InvalidArgumentException;
+import javax.sip.SipException;
+import java.text.ParseException;
/**
* API鍏煎锛氳澶囨帶鍒�
@@ -23,7 +29,7 @@
private SIPCommander cmder;
@Autowired
- private IVideoManagerStorager storager;
+ private IVideoManagerStorage storager;
/**
* 璁惧鎺у埗 - 浜戝彴鎺у埗
@@ -35,7 +41,7 @@
* @return
*/
@RequestMapping(value = "/ptz")
- private JSONObject list(String serial,String command,
+ private void list(String serial,String command,
@RequestParam(required = false)Integer channel,
@RequestParam(required = false)String code,
@RequestParam(required = false)Integer speed){
@@ -44,11 +50,11 @@
logger.debug("妯℃嫙鎺ュ彛> 璁惧浜戝彴鎺у埗 API璋冪敤锛宒eviceId锛歿} 锛宑hannelId锛歿} 锛宑ommand锛歿} 锛宻peed锛歿} ",
serial, code, command, speed);
}
+ if (channel == null) {channel = 0;}
+ if (speed == null) {speed = 0;}
Device device = storager.queryVideoDevice(serial);
if (device == null) {
- JSONObject result = new JSONObject();
- result.put("error","device[ " + serial + " ]鏈壘鍒�");
- return result;
+ throw new ControllerException(ErrorCode.ERROR100.getCode(), "device[ " + serial + " ]鏈壘鍒�");
}
int cmdCode = 0;
switch (command){
@@ -89,7 +95,11 @@
break;
}
// 榛樿鍊� 50
- cmder.frontEndCmd(device, code, cmdCode, speed, speed, speed);
- return null;
+ try {
+ cmder.frontEndCmd(device, code, cmdCode, speed, speed, speed);
+ } catch (SipException | InvalidArgumentException | ParseException e) {
+ logger.error("[鍛戒护鍙戦�佸け璐 浜戝彴鎺у埗: {}", e.getMessage());
+ throw new ControllerException(ErrorCode.ERROR100.getCode(), "鍛戒护鍙戦�佸け璐�: " + e.getMessage());
+ }
}
}
--
Gitblit v1.8.0