| | |
| | | util.ResponseFormat(c, code.Success, tokenRes) |
| | | } |
| | | |
| | | type InitForMonitorArg struct { |
| | | TreeNodes []string `json:"treeNodes"` |
| | | Tasks []string `json:"tasks"` |
| | | } |
| | | |
| | | // @Summary 实时任务监控数据初始化 |
| | | // @Description 实时监控比对数据 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags realTime |
| | | // @Param obj body map true "底库数据" |
| | | // @Param obj body controllers.InitForMonitorArg true "实时任务监控参数" |
| | | // @Success 200 {string} json "{"code":200, msg:"目录结构数据", success:true}" |
| | | // @Failure 500 {string} json "{"code":500, msg:"返回错误信息", success:false}" |
| | | // @Router /data/api-v/realTime/initForMonitoringData [POST] |
| | | //实时监控数据初始化 |
| | | func (rc *RealTimeController) InitForMonitoringData(c *gin.Context) { |
| | | searchBody := make(map[string]interface{}, 0) |
| | | |
| | | //searchBody := make(map[string]interface{}, 0) |
| | | var searchBody InitForMonitorArg |
| | | c.BindJSON(&searchBody) |
| | | index := config.EsInfo.EsIndex.VideoPersons.IndexName + "," + config.EsInfo.EsIndex.Personaction.IndexName |
| | | cameraIdStr := "" |
| | | cameraId := searchBody["treeNodes"].([]interface{}) |
| | | cameraId := searchBody.TreeNodes |
| | | if cameraId != nil && len(cameraId) > 0 { |
| | | esCameraId := strings.Replace(strings.Trim(fmt.Sprint(cameraId), "[]"), " ", "\",\"", -1) |
| | | cameraIdStr = "{\"terms\":{\"cameraId\":[\"" + esCameraId + "\"]}}," |
| | | } |
| | | //判断任务ID |
| | | taskIdStr := "{\"terms\":{\"taskId\":[]}}," |
| | | taskId := searchBody["tasks"].([]interface{}) |
| | | taskId := searchBody.Tasks |
| | | if taskId != nil && len(taskId) > 0 { |
| | | esTaskId := strings.Replace(strings.Trim(fmt.Sprint(taskId), "[]"), " ", "\",\"", -1) |
| | | taskIdStr = "{\"terms\":{\"taskId\":[\"" + esTaskId + "\"]}}," |