| | |
| | | |
| | | type conf struct { |
| | | PhotoUrl string `yaml:"photoUrl"` |
| | | Videopersons string `yaml:"videoPersons"` |
| | | Personaction string `yaml:"personAction"` |
| | | Serverip string `yaml:"serverIp"` |
| | | Serverport string `yaml:"serverPort"` |
| | | Dbtablepersons string `yaml:"dbTablePersons"` |
| | | VideoPersons string `yaml:"videoPersons"` |
| | | PersonAction string `yaml:"personAction"` |
| | | ServerIp string `yaml:"serverIp"` |
| | | ServerPort string `yaml:"serverPort"` |
| | | DbTablePersons string `yaml:"dbTablePersons"` |
| | | } |
| | | |
| | | func init() { |
| | |
| | | //把yaml形式的字符串解析成struct类型 |
| | | yaml.Unmarshal(data, &c) |
| | | weedfsUrl = c.PhotoUrl |
| | | videoPersonUrl = c.Videopersons |
| | | personAction = c.Personaction |
| | | videoPersonUrl = c.VideoPersons |
| | | personAction = c.PersonAction |
| | | } |
| | | |
| | | // 人脸的数据结构 |
| | |
| | | logger.Info("json parse error ", err) |
| | | return |
| | | } |
| | | err1 := EsReq("POST", videoPersonUrl, requstbody) |
| | | resp1, err1 := EsReq("POST", videoPersonUrl, requstbody) |
| | | if err1 != nil { |
| | | logger.Error("上传ES出错!---", err1) |
| | | } else { |
| | | logger.Info("插入es返回的信息:", resp1) |
| | | // 发出录像信号 |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: resp1["_id"].(string), CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, ImgId: i.Id, SdkIds: []string{}}) |
| | | } |
| | | } |
| | | } |
| | |
| | | logger.Info("json parse error ", err) |
| | | return |
| | | } |
| | | err1 := EsReq("POST", videoPersonUrl, requstbody) |
| | | resp1, err1 := EsReq("POST", videoPersonUrl, requstbody) |
| | | |
| | | if err1 != nil { |
| | | logger.Error("上传ES出错!---", err1) |
| | | } else { |
| | | logger.Info("插入es返回的信息:", resp1) |
| | | // 发出录像信号 |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: resp1["_id"].(string), CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, ImgId: i.Id, SdkIds: []string{}}) |
| | | } |
| | | //if msg.RuleResult["cacheData"] != nil { |
| | | // InsertFace(msg.RuleResult["cacheData"].(ruleserver.ResultMsg)) |
| | |
| | | logger.Error("查询摄像机信息失败") |
| | | } |
| | | serverIp, err := GetLocalIP() |
| | | if msg.RuleResult["cacheData"] != nil { |
| | | InsertYolo(msg.RuleResult["cacheData"].(ruleserver.ResultMsg)) |
| | | // 把缓存的数据上传后得到地址存进去 |
| | | |
| | | } |
| | | peraction := Personaction{ |
| | | uuid.NewV4().String(), |
| | | msg.Cid, |
| | |
| | | return |
| | | |
| | | } |
| | | err = EsReq("POST", personAction, requstbody) |
| | | if err != nil { |
| | | resp1, err2 := EsReq("POST", personAction, requstbody) |
| | | if err2 != nil { |
| | | logger.Error("往ES插入数据失败", err) |
| | | } else { |
| | | logger.Debug("插入es返回的数据信息是:", resp1) |
| | | // 发出录像信号 |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: resp1["_id"].(string), CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, ImgId: i.Id, SdkIds: []string{}}) |
| | | logger.Warn("__________________________________________往ES插入yolo数据成功") |
| | | //os.Exit(1) |
| | | } |
| | | if msg.RuleResult["cacheData"] != nil { |
| | | InsertYolo(msg.RuleResult["cacheData"].(ruleserver.ResultMsg)) |
| | | } |
| | | } |
| | | } |
| | |
| | | return |
| | | |
| | | } |
| | | err = EsReq("POST", personAction, requstbody) |
| | | if err != nil { |
| | | resp1, err1 := EsReq("POST", personAction, requstbody) |
| | | if err1 != nil { |
| | | logger.Error("往ES插入数据失败", err) |
| | | } else { |
| | | logger.Info("插入es返回的信息:", resp1) |
| | | // 发出录像信号 |
| | | ruleserver.AddLxMessage(&protomsg.VideotapeInfo{EsDataId: resp1["_id"].(string), CameraId: msg.Cid, TaskId: msg.Tasklab.Taskid, ImgId: i.Id, SdkIds: []string{}}) |
| | | logger.Warn("__________________________________________往ES插入yolo数据成功") |
| | | //os.Exit(1) |
| | | } |