mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-10-07 06:57:54 +00:00
28 lines
593 B
Go
28 lines
593 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type ControlBy struct {
|
|
CreateBy int `gorm:"index;comment:'创建者'"`
|
|
UpdateBy int `gorm:"index;comment:'更新者'"`
|
|
}
|
|
|
|
func (e *ControlBy) SetCreateBy(createBy int) {
|
|
e.CreateBy = createBy
|
|
}
|
|
|
|
func (e *ControlBy) SetUpdateBy(updateBy int) {
|
|
e.UpdateBy = updateBy
|
|
}
|
|
|
|
|
|
type Model struct {
|
|
ID int `gorm:"primaryKey;autoIncrement;comment:'主键编码'"`
|
|
}
|
|
|
|
type ModelTime struct {
|
|
CreatedAt time.Time `gorm:"comment:'创建时间'"`
|
|
UpdatedAt time.Time `gorm:"comment:'最后更新时间'"`
|
|
DeletedAt *time.Time `gorm:"index;comment:'删除时间'"`
|
|
}
|