From 000e51f17eba47c3502ee8f717f53f1fae3d0bbd Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期三, 13 十一月 2019 19:11:35 +0800 Subject: [PATCH] new files --- controllers/camera.go | 63 +++---------------------------- 1 files changed, 7 insertions(+), 56 deletions(-) diff --git a/controllers/camera.go b/controllers/camera.go index 9956bc1..415fece 100644 --- a/controllers/camera.go +++ b/controllers/camera.go @@ -21,9 +21,9 @@ Name string `json:"name"` Type int `json:"type" ` Addr string `json:"addr"` - Areaid string `json:"areaid"` - Longitude float64 `json:"longitude"` - Latitude float64 `json:"latitude"` + Areaid string `json:"areaid"` + Longitude float32 `json:"longitude"` + Latitude float32 `json:"latitude"` Rtsp string `json:"rtsp"` Ip string `json:"ip"` Port int `json:"port"` @@ -164,15 +164,6 @@ return json.Marshal(test) } -// @Summary 灏嗘憚鍍忔満鎸傚埌鎸囧畾鐨勭洰褰曟爲涓� -// @Description 灏嗘憚鍍忔満鎸傚埌鎸囧畾鐨勭洰褰曟爲涓� -// @Produce json -// @Tags camera -// @Param cameraId path string true "鎽勫儚鏈篿d" -// @Param areaId path string true "鐩綍鍖哄煙id" -// @Success 200 {string} json "{"code":200, success:true, msg:"璇锋眰澶勭悊鎴愬姛", data:""}" -// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:"閿欒淇℃伅鍐呭"}" -// @Router /data/api-v/camera/cameraAreaAdd [get] func (ac CameraController) CameraAreaAdd(c *gin.Context) { cameraId := c.Param("cameraId") areaId := c.Param("areaId") @@ -180,15 +171,6 @@ fmt.Println(areaId) } -// @Summary 鍒犻櫎鏌愪竴涓洰褰曟爲涓嬬殑鎸囧畾鎽勫儚鏈� -// @Description 鍒犻櫎鏌愪竴涓洰褰曟爲涓嬬殑鎸囧畾鎽勫儚鏈� -// @Produce json -// @Tags camera -// @Param cameraId path string true "鎽勫儚鏈篿d" -// @Param areaId path string true "鎸囧畾鐩綍鍖哄煙id" -// @Success 200 {string} json "{"code":200, success:true, msg:"璇锋眰澶勭悊鎴愬姛", data:""}" -// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:"閿欒淇℃伅鍐呭"}" -// @Router /data/api-v/camera/cameraAreaDel [get] func (ac CameraController) CameraAreaDel(c *gin.Context) { cameraId := c.Param("cameraId") areaId := c.Param("areaId") @@ -196,15 +178,7 @@ fmt.Println(areaId) } -// @Summary 鑾峰彇杩愯绫诲瀷鑾峰彇鎽勫儚鏈哄垪琛� -// @Description 鑾峰彇杩愯绫诲瀷鑾峰彇鎽勫儚鏈哄垪琛� -// @Produce json -// @Tags camera -// @Param runType query int true "0锛氭煡杞锛�1锛氭煡瀹炴椂" -// @Param cameraName query string false "鏌ヨ鏉′欢" -// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" -// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" -// @Router /data/api-v/camera/getCamerasByRunType [get] + func (cc CameraController) GetCamerasByRunType(c *gin.Context) { runTypeStr := c.Query("runType") @@ -228,15 +202,6 @@ } } -// @Summary 鍒囨崲鎽勫儚鏈鸿繍琛屽疄鏃舵垨杞鐨勫紑鍏� -// @Description 鍒囨崲鎽勫儚鏈鸿繍琛屽疄鏃舵垨杞鐨勫紑鍏� -// @Produce json -// @Tags camera -// @Param cameraId query string true "鎽勫儚鏈篿d" -// @Param runEnable query bool true "寮�鍚細true锛屽叧闂細false" -// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" -// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" -// @Router /data/api-v/camera/updateRunEnable [post] func (cc CameraController) UpdateRunEnable(c *gin.Context) { cameraId := c.PostForm("cameraId") enableStr := c.PostForm("runEnable") @@ -256,18 +221,12 @@ } } -// @Summary 鏇存柊搴曞浘 -// @Description 鍒锋柊搴曞浘 -// @Produce json -// @Tags camera -// @Param cid path string true "鎽勫儚鏈篿d" -// @Success 200 {string} json "{"code":200, success:true, msg:"", data:"杩斿洖鐨勬枃浠舵湇鍔″櫒鍦板潃"}" -// @Failure 500 {string} json "{"code":500, success:false msg:"",data:"閿欒淇℃伅鍐呭"}" -// @Router /data/api-v/camera/updateSnapshotUrl/{cid} [get] func(cc CameraController) UpdateSnapshotUrl(c *gin.Context){ cid := c.Param("cid") - filename, err := service.UpdateSnapshotUrl(cid) + //filename, err := service.UpdateSnapshotUrl(cid) + filename, err := service.UpdateCapture(cid) if err != nil { + logger.Debug("UpdateSnapshotUrl.err:",err) util.ResponseFormat(c, code.ComError, "鏇存柊澶辫触") return } @@ -279,14 +238,6 @@ RunType int `json:"run_type"` } -// @Summary 鎽勫儚鏈鸿疆璇㈠拰瀹炴椂鐘舵�佸垏鎹� -// @Description 鎽勫儚鏈鸿疆璇㈠拰瀹炴椂鐘舵�佸垏鎹� -// @Produce json -// @Tags camera -// @Param changeRunBody body controllers.CameraChangeRunVo true "鍙傛暟缁撴瀯浣�,0锛氬疄鏃跺垏杞锛�1锛氳疆璇㈠垏瀹炴椂" -// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" -// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" -// @Router /data/api-v/camera/changeRunType [post] func (cc CameraController) ChangeRunType(c *gin.Context) { var ccrVo CameraChangeRunVo if err := c.BindJSON(&ccrVo); err != nil { -- Gitblit v1.8.0