zhangzengfei
2024-05-17 9ee887fce2f87f7a79d0b94640cf1d341a254319
controller/captureCtl.go
@@ -38,15 +38,17 @@
      return
   }
   // 如果开启了下级, 身份应该是消息代理, 不再转发到服务器
   face := req.FaceListObject.FaceObject[0]
   logger.Debug("Receive new message, Id:%s Ip:%s faceId:%s, LeftTopX:%d, appearTime:%s", c.RemoteIP(), face.DeviceID, face.FaceID, face.LeftTopX, face.FaceAppearTime)
   // 如果开启了下级, 身份应该是消息代理, 不再转发到服务器
   if config.ClientConf.Enable && config.ServeConf.Role == "agent" {
      go a.Repository.VIIDMsgForward(&req)
   } else if config.ServeConf.Role == "cascade" {
      logger.Debug("Receive new message, Id:%s Ip:%s faceId:%s, LeftTopX:%d, appearTime:%s", c.RemoteIP(), face.DeviceID, face.FaceID, face.LeftTopX, face.FaceAppearTime)
      go service.AddFaceCapture(&face)
   } else {
      logger.Debug("Receive new message, Id:%s Ip:%s faceId:%s, LeftTopX:%d, appearTime:%s", c.RemoteIP(), face.DeviceID, face.FaceID, face.LeftTopX, face.FaceAppearTime)
      go service.AddFaceNotification(&face)
   }
   if config.ForwardConf.SyncServer != "" {
      go a.Repository.FaceForward(req.FaceListObject.FaceObject)
   }