watcher/pkg/model/pusher.go

29 lines
553 B
Go
Raw Normal View History

2024-04-10 17:36:56 +08:00
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:"serializer:json"`
}
func (p *Pusher[T]) TableName() string {
return "pusher"
}