---
panlei
2019-11-07 2b2576642ae036b1930c1abbb628626e7fc500f5
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
40
41
42
package ruleserver
 
import (
    "basic.com/pubsub/protomsg.git"
    "basic.com/valib/logger.git"
    uuid "github.com/satori/go.uuid"
    "ruleprocess/cache"
)
func GetAttachInfo(msg *protomsg.SdkMessage){
    //人脸检测,没有相似的底库人员
    push := new(protomsg.PushAttach)
    localConfig, err := cache.GetServerInfo()
    if err != nil {
        logger.Error("查询本机信息失败!")
    }
    logger.Info("localConfig信息:",localConfig)
    push.ServerId = localConfig.ServerId
    push.ServerName = localConfig.ServerName
    serverIp, err := GetLocalIP()
    push.LocalIp = serverIp
    // 查询cameraName
    camera, err := cache.GetCameraById(msg.Cid)
    if err != nil {
        logger.Error("查询摄像机信息失败")
    }
    push.Cam = &camera
    push.PushId = uuid.NewV4().String()
    // 视频地址占位符
    //localConfig1, err := cache.GetServerInfo()
    //if err != nil {
    //    panic("配置文件不合法")
    //}
    //logger.Info("请求视频路径:",msg.Push,serverIp,camera)
    // weedfsUrl := "http://" + localConfig1.WebPicIp + ":" + strconv.Itoa(int(localConfig1.WebPicPort)) + "/dir/assign"
    //if path,err := WeedFSClient.GetFid(weedfsUrl);err != nil {
    //    logger.Info("请求文件地址失败:",err)
    //} else {
    //    logger.Info("视频路径为:",path)
    //    push.VideoUrl = path
    //}
    msg.Push = push
}