qixiaoning
2025-07-08 84d2ef9760af0a4a4aa933937294400b3caa291d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package models
 
type EventPushRule struct {
    Id                 string             `gorm:"primary_key;column:id" json:"id"`
    TopicType         string             `gorm:"column:topic_type" json:"topic_type"`//参数主题,目前分为五类(摄像机、底库、任务、人员、报警等级)
    TopicArg         string             `gorm:"column:topic_arg" json:"topic_arg"`//主题对应的具体参数
    Operator         string             `gorm:"column:operator" json:"operator"`
    OperatorType     string             `gorm:"column:operator_type" json:"operator_type"`
    RuleValue         string             `gorm:"column:rule_value" json:"rule_value"`
    EventPushId     string             `gorm:"column:event_push_id" json:"event_push_id"`
}
 
func (EventPushRule) TableName() string {
    return "event_push_rule"
}
 
func (epr *EventPushRule) FindByEventPushId(eventPushId string) (list []EventPushRule,err error) {
    if err := db.Table("event_push_rule").Where("event_push_id=?",eventPushId).Scan(&list).Error;err !=nil {
        return nil,err
    }
    return list,nil
}