| | |
| | | |
| | | type SubscribeController struct { |
| | | Repository repository.SubscribeRepository |
| | | Srv repository.CaptureRepository |
| | | Capture repository.CaptureRepository |
| | | Ape repository.ApeRepository |
| | | } |
| | | |
| | | // 构造函数 |
| | | func NewSubscribeController() SubscribeController { |
| | | svr := repository.NewSubscribeRepository() |
| | | svr1 := repository.NewCaptureRepository() |
| | | controller := SubscribeController{svr, svr1} |
| | | svr2 := repository.NewApeRepository() |
| | | controller := SubscribeController{svr, svr1, svr2} |
| | | |
| | | return controller |
| | | } |
| | |
| | | c.JSON(http.StatusOK, gin.H{"ResponseStatusListObject": rsp}) |
| | | } |
| | | |
| | | func (s SubscribeController) Notifications(c *gin.Context) { |
| | | func (s SubscribeController) VIIDNotifications(c *gin.Context) { |
| | | var rsp vo.ResponseStatusList |
| | | var req vo.RequestSubscribeNotificationBind |
| | | if err := c.BindJSON(&req); err != nil { |
| | |
| | | }) |
| | | |
| | | // 转发 |
| | | if config.ForwardConf.SyncServer != "" { |
| | | go s.Srv.FaceForward(msg.FaceObjectList.FaceObject) |
| | | if config.ForwardConf.SyncServer != "" && len(msg.FaceObjectList.FaceObject) > 0 { |
| | | go s.Capture.FaceForward(msg.FaceObjectList.FaceObject) |
| | | } |
| | | |
| | | if len(msg.DeviceList.APEObject) > 0 { |
| | | fromId := c.GetHeader("User-Identify") |
| | | go s.Ape.HandleNotification(fromId, msg.DeviceList.APEObject) |
| | | } |
| | | } |
| | | |