From a527225f7f3cc93882aa870c20f0985d07d6fe92 Mon Sep 17 00:00:00 2001
From: sunty <suntianyu0923@163.com>
Date: 星期四, 22 八月 2019 18:12:03 +0800
Subject: [PATCH] set yn main port 7100

---
 controllers/syssetcont.go |   42 +++++++++++++++++++++++++-----------------
 1 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/controllers/syssetcont.go b/controllers/syssetcont.go
index 9bb4cbc..fe25b70 100644
--- a/controllers/syssetcont.go
+++ b/controllers/syssetcont.go
@@ -4,6 +4,7 @@
 	"basic.com/dbapi.git"
 	"github.com/gin-gonic/gin"
 	"webserver/extend/code"
+	"webserver/extend/config"
 	"webserver/extend/util"
 )
 
@@ -15,6 +16,8 @@
 	Id string  `json:"id"`
 	AlarmIp string `json:"alarm_ip,omitempty" example:"192.168.1.182"`
 	AlarmPort int `json:"alarm_port,omitempty" example:"22122"`
+	AlarmThresholdType int `json:"alarm_threshold_type"`//鎶ヨ闃堝�肩被鍨嬭缃細1:鎸夋渶楂樺垎,2:鎸夐槇鍊间互涓�
+	AlarmThreshold int `json:"alarm_threshold"`//鎶ヨ闃堝��
 	WebPicIp string `json:"web_pic_ip,omitempty" example:""`
 	WebPicPort int `json:"web_pic_port,omitempty" example:"22122"`
 	EsPicIp string `json:"es_pic_ip,omitempty" example:""`
@@ -29,18 +32,18 @@
 }
 
 type Gb28181ConfigVo struct {
-	Id string `json:"Id" gorm:"primary_key" `
-	ServerIp string `json:"ServerIp" example:"鍥芥爣鏈嶅姟鍣↖P" gorm:"column:ServerIp"`
-	ServerPort int `json:"ServerPort" example:"鏈嶅姟鍣ㄧ鍙�:8060" gorm:"column:ServerPort"`
-	PublicId string `json:"ServerId" example:"鍥芥爣鏈嶅姟鍣↖d" gorm:"column:PublicId"`
-	GbServerPort int `json:"GbServerPort" example:"鍥芥爣鏈嶅姟绔彛:7060" gorm:"column:GbServerPort"`
-	IsAuth bool `json:"IsAuth" example:"鏄惁寮�鍚壌鏉�:true" gorm:"column:IsAuth"`
-	Password string `json:"Password" example:"瀵嗙爜" gorm:"column:Password"`
-	UpdateTime string `json:"UpdateTime" gorm:"column:UpdateTime"`
+	Id string `json:"Id"`
+	ServerIp string `json:"ServerIp" example:"鍥芥爣鏈嶅姟鍣↖P"`
+	ServerPort int `json:"ServerPort" example:"鏈嶅姟鍣ㄧ鍙�:8060"`
+	PublicId string `json:"PublicId" example:"鍥芥爣鏈嶅姟鍣↖d"`
+	GbServerPort int `json:"GbServerPort" example:"鍥芥爣鏈嶅姟绔彛:7060"`
+	IsAuth bool `json:"IsAuth" example:"鏄惁寮�鍚壌鏉�:true"`
+	Password string `json:"Password" example:"瀵嗙爜"`
+	UpdateTime string `json:"UpdateTime"`
 }
 
-// @Summary 瀛樺偍淇℃伅鏌ヨ
-// @Description 瀛樺偍淇℃伅鏌ヨ
+// @Summary 鍩虹璁剧疆鏌ヨ
+// @Description 鍩虹璁剧疆鏌ヨ
 // @Accept  json
 // @Produce json
 // @Tags sysset
@@ -57,8 +60,8 @@
 	}
 }
 
-// @Summary 瀛樺偍淇℃伅淇敼
-// @Description 瀛樺偍淇℃伅淇敼
+// @Summary 鎶ヨ璁剧疆淇敼
+// @Description 鎶ヨ璁剧疆淇敼
 // @Accept  json
 // @Produce json
 // @Tags sysset
@@ -83,8 +86,8 @@
 	}
 }
 
-// @Summary 瀛樺偍淇℃伅淇敼
-// @Description 瀛樺偍淇℃伅淇敼
+// @Summary 鎶ヨ鏃堕暱淇敼
+// @Description 鎶ヨ鏃堕暱淇敼
 // @Accept  json
 // @Produce json
 // @Tags sysset
@@ -145,8 +148,13 @@
 	if !b { // 鏌ヨ鏄惁瀛樺湪
 		util.ResponseFormat(c, code.ServiceInsideError,"鏌ヨ澶辫触")
 	}else {
-		resData["dev_id"] = sysconf.GetServerId()
-		resData["dev_name"] = sysconf.GetServerName()
+		resData["server_id"] = sysconf.GetServerId()
+		resData["server_name"] = sysconf.GetServerName()
+		ipv4, mask, _ := util.GetLocalIP(config.Server.NetworkAdapter)
+		gateway, _ := util.GetDefaultRoute(config.Server.NetworkAdapter)
+		resData["ip"] = ipv4
+		resData["subMask"] = mask
+		resData["gateway"] = gateway
 		// 瀛樺湪
 		util.ResponseFormat(c, code.Success, resData)
 	}
@@ -164,7 +172,7 @@
 // @Router /data/api-v/sysset/saveDevInfo [POST]
 func (sset SysSetController) SaveDevInfo(c *gin.Context){
 
-	dev_name := c.Request.FormValue("dev_name")
+	dev_name := c.PostForm("server_name")
 	var api dbapi.SysSetApi
 	paramBody :=make(map[string]interface{},0)
 	paramBody["serverName"] = dev_name

--
Gitblit v1.8.0