sunty
2020-08-20 9303b69ea569bcb5e581147543a3fd58e90d0d25
controllers/task.go
@@ -102,7 +102,7 @@
         //处理已被删除的任务
         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 {
@@ -167,6 +167,7 @@
// @Security ApiKeyAuth
// @Summary 给任务添加算法
// @Description 任务添加算法
// @Accept json
// @Produce json
// @Tags task
// @Param taskSdkAdd body controllers.TaskSdkAdd true "任务id"
@@ -219,6 +220,7 @@
// @Security ApiKeyAuth
// @Summary 更新任务名称
// @Description 更新任务名称
// @Accept x-www-form-urlencoded
// @Produce json
// @Tags task
// @Param taskId formData string true "taskId"
@@ -250,6 +252,7 @@
// @Security ApiKeyAuth
// @Summary 更新任务状态
// @Description (算法不变,只更新任务状态)
// @Accept json
// @Produce json
// @Tags task
// @Param taskStatus body controllers.TaskStatusVo true "参数"
@@ -341,6 +344,7 @@
// @Security ApiKeyAuth
// @Summary 删除算法规则
// @Description 删除算法规则
// @Accept x-www-form-urlencoded
// @Produce json
// @Tags 算法规则
// @Param taskId formData string true "taskId"
@@ -388,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, "")
   }
}