sunty
2019-07-12 d42b09cda8b2bc58c43c200f3aabdb0b2a7e9211
controllers/camera.go
@@ -4,6 +4,7 @@
   "encoding/json"
   "fmt"
   "strconv"
   "webserver/extend/logger"
   "github.com/gin-gonic/gin"
@@ -20,7 +21,7 @@
   Name      string  `json:"name"`
   Type      int     `json:"type" `
   Addr      string  `json:"addr"`
   Areaid    uint    `json:"areaid"`
   Areaid    string    `json:"areaid"`
   Longitude float64 `json:"longitude"`
   Latitude  float64 `json:"latitude"`
   Rtsp      string  `json:"rtsp"`
@@ -84,7 +85,7 @@
      return
   }
   paramBody := util.Struct2Map(cam)
   if api.CameraAdd(paramBody) {
   if api.CameraUpdate(paramBody) {
      util.ResponseFormat(c, code.Success, cam)
      return
   }
@@ -103,7 +104,7 @@
func (ac CameraController) CameraDel(c *gin.Context) {
   var api dbapi.CameraApi
   cid := c.Param("cid")
   logger.Debug("CameraDel.cid:",cid)
   if api.CameraDelete(cid) {
      util.ResponseFormat(c, code.Success, "删除成功")
      return