go17/vblog/utils/resource.go

21 lines
485 B
Go
Raw Permalink Normal View History

2024-12-01 12:00:49 +08:00
package utils
import "time"
2024-12-08 10:10:37 +08:00
func NewResourceMeta() *ResourceMeta {
return &ResourceMeta{
CreatedAt: time.Now(),
}
}
2024-12-01 12:00:49 +08:00
type ResourceMeta struct {
// 资源Id
Id uint `json:"id" gorm:"primaryKey;column:id"`
// 创建时间
CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null"`
2024-12-01 16:05:07 +08:00
// 用户名称
CreateBy string `json:"create_by" gorm:"column:create_by;type:varchar(100)"`
2024-12-01 12:00:49 +08:00
// 更新时间
UpdatedAt *time.Time `json:"updated_at" gorm:"column:updated_at"`
}