qixiaoning
2025-08-22 0f97177f258c67397b206b70e5aea2b24a4868c1
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
package models
 
type EventPushServer struct {
    Id                 string         `gorm:"primary_key;column:id" json:"id"`
    ServerIp         string         `gorm:"column:server_ip" json:"server_ip"`
    Port             int         `gorm:"column:port" json:"port"`
    Enable             bool         `gorm:"column:enable" json:"enable"`
    Type             int         `gorm:"column:type" json:"type"`
    Url             string         `gorm:"column:url" json:"url"`
    EventPushId     string         `gorm:"column:event_push_id" json:"event_push_id"`
}
 
var (
    PUSH_IP_PORT_TYPE = 0
    PUSH_URL_TYPE = 1
)
 
func (EventPushServer) TableName() string {
    return "event_push_server"
}
 
func (eps *EventPushServer) FindByEventPushId(eventPushId string) (list []EventPushServer,err error){
    if err:=db.Table("event_push_server").Where("event_push_id=?",eventPushId).Scan(&list).Error;err !=nil {
        return nil,err
    }
    return list,nil
}