carbon/gorm_model.go
gouguoyin@juzifenqi.com 1cc4acd64d 支持gorm
2020-09-09 18:56:58 +08:00

13 lines
513 B
Go

package carbon
import (
"time"
)
type Model struct {
Id int64 `gorm:"primary_key;comment:'主键ID'" json:"id"`
CreatedAt ToDateTimeString `gorm:"comment:'创建时间';type:timestamp not null;default:current_timestamp;" json:"created_at"`
UpdatedAt ToDateTimeString `gorm:"comment:'更新时间';type:timestamp on update current_timestamp;omitempty;default:current_timestamp;" json:"updated_at"`
DeletedAt *time.Time `gorm:"comment:'删除时间'" json:"deleted_at" sql:"index"`
}