panlei
2019-10-10 f490b28775ad05e29fb89444fe78316eda67f492
insertdata/insertDataToEs.go
@@ -2,12 +2,12 @@
import (
   "basic.com/valib/logger.git"
   "ruleprocess/structure"
   "encoding/base64"
   "encoding/json"
   "errors"
   "net"
   "ruleprocess/cache"
   "ruleprocess/structure"
   "strconv"
   "time"
@@ -68,8 +68,24 @@
   IsCollect       int                    `json:"isCollect"`
   IsDelete        int                    `json:"isDelete"`
   BaseInfo        []*structure.BaseInfo `json:"baseInfo"`
   TargetInfo      Target
}
type Target struct {
   TargetId       string `json:"targetId"`
   TargetScore    float64 `json:"targetScore"`
   TargetLocation Points
}
type Points struct {
   TopLeft  Point `json:"topLeft"`
   BottomRight Point `json:"bottomRight"`
}
type Point struct {
   Lat float64 `json:"lat"`
   Lon float64 `json:"lon"`
}
//  yolo行为的数据结构
type Personaction struct {
   Id              string      `json:"id"`
@@ -229,6 +245,10 @@
            if linkId != "" {
               linksId = linkId
            }
            var target = new(Target)
            target.TargetId = strconv.FormatUint(face.Id, 10)
            target.TargetScore = face.Score
            target.TargetLocation = Points{TopLeft:Point{face.Location.X,face.Location.Y},BottomRight:Point{face.Location.X+face.Location.Width,face.Location.Y+face.Location.Height}}
            //logger.Info("人脸的id:",strconv.FormatUint(face.Id, 10))
            //logger.Info("人脸的分值:",face.Score)
            pervideo := PerVideoPicture{
@@ -263,6 +283,7 @@
               0,
               0,
               face.Liker,
               *target,
            }
            requstbody, err := json.Marshal(pervideo)