panlei
2019-07-15 6778d033d1659069119cd0fb7fc5947b29c1cd5e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package labelFilter
 
import (
    "basic.com/pubsub/protomsg.git"
    "ruleprocess/cache"
    "ruleprocess/logger"
    "ruleprocess/ruleserver"
)
 
type Label struct {
    CameraId      string
    CameraName    string
    CameraAddr    string
    TaskId        string
    Persons       []*Person
    DefenceLevel  string
}
 
type Person struct {
    Id     string
    Level  string
    Gender string
    Age    int
    Race   string
    Likers []*protomsg.Baseinfo
}
 
func DataFormatToLabel(result ruleserver.ResultMsg) Label {
    labelData := Label{}
    labelData.CameraId = result.Cid
    camera, err := cache.GetCameraById(result.Cid)
    if err != nil {
        logger.Error("查询摄像机信息出错")
    }
    labelData.CameraName = camera.Name
    labelData.CameraAddr = camera.Addr
    labelData.TaskId = result.Tasklab.Taskid
    return Label{}
}