package model import ( "gorm.io/gorm" "time" ) type PusherType int const ( PusherType_AnPusher = iota + 1 ) type Pusher[T any] struct { ID uint `gorm:"primaryKey" json:"id"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt gorm.DeletedAt `gorm:"index"` Type PusherType `json:"type"` Name string `json:"name"` Remark string `json:"remark"` Option T `json:"option" gorm:"type:json;serializer:json"` } func (p *Pusher[T]) TableName() string { return "pusher" }