| 123456789101112131415161718192021222324252627282930313233343536373839 |
- package entity
- import "gorm.io/gorm"
- const (
- ModelPrefix = "magic_"
- SysModelPrefix = "sys_"
- )
- type Member struct {
- ID int64
- OpenID string
- }
- type MysqlIdModel struct {
- Id int64 `json:"id" gorm:"primarykey;comment:id"`
- }
- //db.Exec("ALTER TABLE your_table_name AUTO_INCREMENT = 1000")
- type MysqlTimeModel struct {
- CreatedAt int64 `json:"created_at,omitempty" gorm:"autoCreateTime;comment:创建时间"`
- UpdatedAt int64 `json:"updated_at,omitempty" gorm:"autoUpdateTime;comment:更新时间"`
- }
- type MysqlDeleteModel struct {
- DeletedAt gorm.DeletedAt `gorm:"index;comment:删除时间"`
- }
- type MysqlBaseModel struct {
- MysqlIdModel
- MysqlTimeModel
- }
- type MysqlFullModel struct {
- MysqlIdModel
- MysqlTimeModel
- MysqlDeleteModel
- }
|