zhangzengfei
2024-06-18 9843a0970dcccfc9bdaa99a4f51053f64c8cc9fa
修改person订阅
2个文件已修改
8 ■■■■ 已修改文件
service/notification.go 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/subscribe.go 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
service/notification.go
@@ -48,6 +48,7 @@
    task.mutex.Lock()
    defer task.mutex.Unlock()
    logger.Debug("Add Face Notification %s. faceId: %s", task.conf.Ext.Title, face.FaceID)
    task.faceList = append(task.faceList, face)
}
@@ -59,6 +60,7 @@
    task.mutex.Lock()
    defer task.mutex.Unlock()
    logger.Debug("Add Person Notification  %s. personId: %s", task.conf.Ext.Title, person.PersonID)
    task.personList = append(task.personList, person)
}
@@ -72,6 +74,7 @@
        case vo.SubscribeFace:
            msg = task.packFaceNotificationMsg()
        case vo.SubscribePerson:
            msg = task.packPersonNotificationMsg()
        }
        if msg != nil {
@@ -122,7 +125,7 @@
func (task *NotificationTask) packPersonNotificationMsg() *vo.RequestSubscribeNotification {
    triggerTime := time.Now().Format("20060102150405")
    if len(task.faceList) == 0 {
    if len(task.personList) == 0 {
        return nil
    }
service/subscribe.go
@@ -100,7 +100,6 @@
        return true
    })
    logger.Debug("Add Face Notification. faceId: %s", face.FaceID)
}
func AddPersonNotification(person *vo.PersonObject) {
@@ -108,6 +107,4 @@
        value.(TaskProcInfo).task.addPerson(person)
        return true
    })
    logger.Debug("Add Person Notification. personId: %s", person.PersonID)
}