From d42b09cda8b2bc58c43c200f3aabdb0b2a7e9211 Mon Sep 17 00:00:00 2001 From: sunty <1172534965@qq.com> Date: 星期五, 12 七月 2019 12:02:14 +0800 Subject: [PATCH] fix search controllers --- controllers/syssetcont.go | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/controllers/syssetcont.go b/controllers/syssetcont.go index 3d3b3be..fb4aa71 100644 --- a/controllers/syssetcont.go +++ b/controllers/syssetcont.go @@ -3,7 +3,6 @@ import ( "basic.com/dbapi.git" "github.com/gin-gonic/gin" - "time" "webserver/extend/code" "webserver/extend/util" ) @@ -30,13 +29,14 @@ } type Gb28181ConfigVo struct { - ID string `json:"ID,omitempty" gorm:"primary_key" ` - ServerIp string `json:"ServerIp,omitempty" example:"SIP鏈嶅姟鍣↖P" gorm:"column:ServerIp"` - ServerPort int `json:"ServerPort,omitempty" example:"21231" gorm:"column:ServerPort"` - ServerId string `json:"ServerId,omitempty" example:"SIP鏈嶅姟鍣↖d" gorm:"column:ServerId"` - UserAuthId string `json:"UserAuthId,omitempty" example:"SIP鐢ㄦ埛璁よ瘉ID" gorm:"column:UserAuthId"` - Password string `json:"Password,omitempty" example:"瀵嗙爜" gorm:"column:Password"` - UpdateTime time.Time `json:"-" 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 瀛樺偍淇℃伅鏌ヨ @@ -145,8 +145,8 @@ 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() // 瀛樺湪 util.ResponseFormat(c, code.Success, resData) } @@ -164,7 +164,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 @@ -205,7 +205,7 @@ // @Failure 500 {string} json "{"code":500, msg:"杩斿洖閿欒淇℃伅", success:false}" // @Router /data/api-v/sysset/gb28181ConfigEdit [POST] func (sset SysSetController) Gb28181ConfigEdit(c *gin.Context) { - var args LocalConfigVo + var args Gb28181ConfigVo err := c.BindJSON(&args) if err !=nil { util.ResponseFormat(c,code.RequestParamError,"鍙傛暟鏈夎") -- Gitblit v1.8.0