| | |
| | | "ruleprocess/util" |
| | | ) |
| | | |
| | | var weedfsUrl string |
| | | var weedfsUrl,videoPersonUrl,personAction string |
| | | |
| | | type conf struct { |
| | | PhotoUrl string `yaml:"photoUrl"` |
| | | Videopersons string `yaml:"videopersons"` |
| | | Personaction string `yaml:"personaction"` |
| | | } |
| | | |
| | | func init() { |
| | |
| | | //把yaml形式的字符串解析成struct类型 |
| | | yaml.Unmarshal(data, &c) |
| | | weedfsUrl = c.PhotoUrl |
| | | videoPersonUrl = c.Videopersons |
| | | personAction = c.Personaction |
| | | } |
| | | |
| | | // 人脸的数据结构 |
| | |
| | | logger.Info("json parse error ", err) |
| | | return |
| | | } |
| | | err1 := EsReq("POST", "http://192.168.1.182:9200/videopersons/perVideoPicture", requstbody) |
| | | err1 := EsReq("POST", videoPersonUrl, requstbody) |
| | | if err1 != nil { |
| | | logger.Error("上传ES出错!---", err1) |
| | | } |
| | |
| | | logger.Info("json parse error ", err) |
| | | return |
| | | } |
| | | err1 := EsReq("POST", "http://192.168.1.182:9200/videopersons/perVideoPicture", requstbody) |
| | | err1 := EsReq("POST", videoPersonUrl, requstbody) |
| | | if err1 != nil { |
| | | logger.Error("上传ES出错!---", err1) |
| | | } |
| | |
| | | return |
| | | |
| | | } |
| | | err = EsReq("POST", "http://192.168.1.182:9200/personaction/perVideoAction", requstbody) |
| | | err = EsReq("POST", personAction, requstbody) |
| | | if err != nil { |
| | | logger.Error("往ES插入数据失败", err) |
| | | } else { |
| | |
| | | return |
| | | |
| | | } |
| | | err = EsReq("POST", "http://192.168.1.182:9200/personaction/perVideoAction", requstbody) |
| | | err = EsReq("POST", personAction, requstbody) |
| | | if err != nil { |
| | | logger.Error("往ES插入数据失败", err) |
| | | } else { |
| | |
| | | //os.Exit(1) |
| | | } |
| | | } |
| | | |
| | | // 获取本机ip |
| | | func GetLocalIP() (ipv4 string, err error) { |
| | | var ( |