From 7c811247ecf143e08c576986a884bedadc57dd66 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期五, 05 六月 2020 18:29:41 +0800 Subject: [PATCH] add refresh token to resp --- controllers/task.go | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/controllers/task.go b/controllers/task.go index 1bd5e75..8c2e205 100644 --- a/controllers/task.go +++ b/controllers/task.go @@ -38,6 +38,7 @@ FaceExtract_VirtualSdkId = "virtual-faceextract-sdk-pull"//缁撴灉杈撳嚭鐨勭畻娉昳d ) +// @Security ApiKeyAuth // @Summary 鏌ユ壘鎵�鏈変换鍔★紝鍖呭惈浠诲姟淇℃伅鍜屽搴旂殑绠楁硶淇℃伅 // @Description 鏌ユ壘鎵�鏈変换鍔� // @Produce json @@ -69,6 +70,7 @@ } } +// @Security ApiKeyAuth // @Summary 妫�绱㈤〉闈㈣幏鍙栨墍鏈変换鍔″垪琛紙鍖呭惈宸插垹闄ょ殑浠诲姟锛� // @Description 妫�绱㈤〉闈㈣幏鍙栨墍鏈変换鍔″垪琛紙鍖呭惈宸插垹闄ょ殑浠诲姟锛� // @Produce json @@ -100,14 +102,16 @@ //澶勭悊宸茶鍒犻櫎鐨勪换鍔� localConf, _ := cache.GetServerInfo() if localConf.AlarmIp != "" && localConf.ServerId != "" && localConf.AlarmPort>0 { - indexName := config.EsInfo.EsIndex.VideoPersons.IndexName + "," + config.EsInfo.EsIndex.Personaction.IndexName + indexName := config.EsInfo.EsIndex.AiOcean.IndexName esTaskM, e := esutil.AggregateTaskList(localConf.AlarmIp, strconv.Itoa(int(localConf.AlarmPort)), indexName, localConf.ServerId) if e==nil && esTaskM !=nil { for _,tM :=range esTaskM { if _,ok := m[tM["taskId"].(string)];!ok {//琛ㄧず姝や换鍔″凡琚垹闄� + taskId := tM["taskId"].(string) + m[taskId] = taskId tasks = append(tasks, TaskSdkVo{ Task:TaskVo{ - Taskid: tM["taskId"].(string), + Taskid: taskId, Taskname: tM["taskName"].(string), DelFlag: true, }, @@ -123,6 +127,7 @@ } } +// @Security ApiKeyAuth // @Summary 娣诲姞浠诲姟 // @Description 鏌ユ壘鎵�鏈変换鍔� // @Accept json @@ -159,8 +164,10 @@ Sort int `json:"sort"` } +// @Security ApiKeyAuth // @Summary 缁欎换鍔℃坊鍔犵畻娉� // @Description 浠诲姟娣诲姞绠楁硶 +// @Accept json // @Produce json // @Tags task // @Param taskSdkAdd body controllers.TaskSdkAdd true "浠诲姟id" @@ -184,6 +191,7 @@ } } +// @Security ApiKeyAuth // @Summary 浠诲姟鍒犻櫎绠楁硶 // @Description 鏍规嵁taskid鍜宻dkid鍒犻櫎 // @Produce json @@ -209,8 +217,10 @@ } } +// @Security ApiKeyAuth // @Summary 鏇存柊浠诲姟鍚嶇О // @Description 鏇存柊浠诲姟鍚嶇О +// @Accept x-www-form-urlencoded // @Produce json // @Tags task // @Param taskId formData string true "taskId" @@ -239,8 +249,10 @@ Enable bool `json:"enable"` } +// @Security ApiKeyAuth // @Summary 鏇存柊浠诲姟鐘舵�� // @Description 锛堢畻娉曚笉鍙�,鍙洿鏂颁换鍔$姸鎬侊級 +// @Accept json // @Produce json // @Tags task // @Param taskStatus body controllers.TaskStatusVo true "鍙傛暟" @@ -264,7 +276,7 @@ } } - +// @Security ApiKeyAuth // @Summary 鍒犻櫎浠诲姟 // @Description 鏍规嵁浠诲姟id鍒犻櫎浠诲姟 // @Produce json @@ -302,6 +314,7 @@ SdkArgValue string `json:"sdk_arg_value"` } +// @Security ApiKeyAuth // @Summary 淇濆瓨绠楁硶瑙勫垯 // @Description 淇濆瓨绠楁硶瑙勫垯 // @Accept json @@ -328,8 +341,10 @@ } } +// @Security ApiKeyAuth // @Summary 鍒犻櫎绠楁硶瑙勫垯 // @Description 鍒犻櫎绠楁硶瑙勫垯 +// @Accept x-www-form-urlencoded // @Produce json // @Tags 绠楁硶瑙勫垯 // @Param taskId formData string true "taskId" @@ -352,7 +367,7 @@ } } - +// @Security ApiKeyAuth // @Summary 鏌ヨ绠楁硶瑙勫垯 // @Description 鏌ヨ绠楁硶瑙勫垯 // @Produce json @@ -377,3 +392,21 @@ util.ResponseFormat(c,code.ComError,"鏌ヨ澶辫触") } } + +// @Security ApiKeyAuth +// @Summary 缁熻姣忎釜浠诲姟鐨勬憚鍍忔満鏁伴噺 +// @Description 缁熻姣忎釜浠诲姟鐨勬憚鍍忔満鏁伴噺 +// @Produce json +// @Tags task +// @Success 200 {string} json "{"code":200, success:true, msg:"", data:""}" +// @Failure 500 {string} json "{"code":500, success:false, msg:"",data:""}" +// @Router /data/api-v/task/statisticTaskCamera [get] +func (tc TaskController) StatisticTaskCamera(c *gin.Context) { + var taskApi dbapi.TaskApi + b,d := taskApi.StatisticTaskCamera() + if b { + util.ResponseFormat(c,code.Success, d) + } else { + util.ResponseFormat(c,code.ComError, "") + } +} -- Gitblit v1.8.0