Files
go-admin/common/models/by.go
T
linwenxiang c294bb1585 Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	template/v4/dto.go.template
2021-03-04 23:47:14 +08:00

30 lines
698 B
Go

package models
import (
"time"
"gorm.io/gorm"
)
type ControlBy struct {
CreateBy int `json:"createBy" gorm:"index;comment:创建者"`
UpdateBy int `json:"updateBy" 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 `json:"id" gorm:"primaryKey;autoIncrement;comment:主键编码"`
}
type ModelTime struct {
CreatedAt time.Time `json:"createdAt" gorm:"comment:创建时间"`
UpdatedAt time.Time `json:"updatedAt" gorm:"comment:最后更新时间"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index;comment:删除时间"`
}