From 7c811247ecf143e08c576986a884bedadc57dd66 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期五, 05 六月 2020 18:29:41 +0800
Subject: [PATCH] add refresh token to resp

---
 controllers/camera.go |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/controllers/camera.go b/controllers/camera.go
index c660dca..03c36ee 100644
--- a/controllers/camera.go
+++ b/controllers/camera.go
@@ -54,14 +54,13 @@
 
 type SensorVo struct {
 	Id        string       `json:"id"`
-	Type 	  int 		   `json:"type"`
+	Type 	  string 	   `json:"type"`
 	Ip 		  string       `json:"ip"`
 	Port 	  int 		   `json:"port"`
 	Username  string       `json:"username"`
 	Password  string 	   `json:"password"`
 	Threshold int 		   `json:"threshold"`
 	Enable 	  bool 		   `json:"enable"`
-	DevId  	  string       `json:"devId"`
 }
 
 // @Summary 娣诲姞鎽勫儚鏈�
@@ -113,6 +112,7 @@
 		util.ResponseFormat(c, code.RequestParamError, "鍙傛暟閿欒")
 		return
 	}
+	logger.Debug("camera sensors:", cam.Sensors)
 	paramBody := util.Struct2Map(cam)
 	if api.CameraUpdate(paramBody) {
 		util.ResponseFormat(c, code.Success, cam)
@@ -162,12 +162,22 @@
 	//2019-11-02鏂板闇�姹傦紝鏄剧ず姣忎釜鎽勫儚鏈虹殑澶勭悊鏈嶅姟鍣ㄤ俊鎭�,褰掑睘鐨勮妭鐐规湇鍔″櫒鍚嶇О
 	m := util.Struct2Map(camera)
 	m["runServerName"] = ""
+	m["resolution_width"] = camera.ResolutionWidth
+	m["resolution_height"] = camera.ResolutionHeight
 	//鎽勫儚鏈哄垎杈ㄧ巼
-	dResolution := Resolution{
+	dRe0 := Resolution{
 		Width: 0,
 		Height: 0,
 	}
-	m["resolutions"] = []Resolution{ dResolution }
+	dRe1 := Resolution{
+		Width: 1920,
+		Height: 1080,
+	}
+	dRe2 := Resolution{
+		Width: 2688,
+		Height: 1520,
+	}
+	m["resolutions"] = []Resolution{ dRe0, dRe1, dRe2 }
 	if camera.RunServerId !="" {
 		localConf, e := cache.GetServerInfo()
 		if e ==nil {

--
Gitblit v1.8.0