From 481471461d61552d4253727b16024c7d2398babe Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期六, 27 七月 2019 18:40:24 +0800 Subject: [PATCH] fix bug --- controllers/camera.go | 6 +++--- extend/code/code.go | 3 +++ controllers/cameraTask.go | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/controllers/camera.go b/controllers/camera.go index c0272b9..6c0611b 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"` diff --git a/controllers/cameraTask.go b/controllers/cameraTask.go index 4066ceb..0e3b139 100644 --- a/controllers/cameraTask.go +++ b/controllers/cameraTask.go @@ -256,7 +256,11 @@ var api dbapi.CameraTaskApi flag, data := api.UpdateCameraTaskStatus(paramVo.CameraId, paramVo.TaskId, paramVo.Status) if flag { - util.ResponseFormat(c,code.Success,data) + if data.(string) == "姝や换鍔′负鍋滅敤鐘舵�侊紝璇峰湪浠诲姟绠$悊涓紑鍚紒"{ + util.ResponseFormat(c,code.TaskStoped,data) + } else { + util.ResponseFormat(c,code.UpdateSuccess,data) + } } else { util.ResponseFormat(c,code.ComError,data) } diff --git a/extend/code/code.go b/extend/code/code.go index b54c52c..847808b 100644 --- a/extend/code/code.go +++ b/extend/code/code.go @@ -52,5 +52,8 @@ DbPersonUpdateSuccess = &Code{ http.StatusOK, true, "浜哄憳鏇存柊鎴愬姛"} CompareResultGone = &Code{ http.StatusOK,true,"涓婃姣斿宸插け鏁堬紝璇蜂粠鏂版瘮瀵�"} + + TaskStoped = &Code{http.StatusOK, true, "姝や换鍔′负鍋滅敤鐘舵�侊紝璇峰湪浠诲姟绠$悊涓紑鍚紒"} + ComError = &Code{http.StatusInternalServerError, false, ""} ) -- Gitblit v1.8.0