watcher/pkg/model/pusher.go
timerzz 98520d6315
All checks were successful
Build image / build (push) Successful in 1m12s
fix 修改gorm版本,解决pgsql automrigate 问题
2024-05-12 22:27:12 +08:00

29 lines
563 B
Go

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"
}