model

package
v0.0.0-...-7ed5fb6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UmsAdminStatusValid int8 = iota
	UmsAdminStatusInvalidValid
)

Variables

This section is empty.

Functions

func NewDbEngine

func NewDbEngine(dbSetting *setting.DatabaseSettingS) (*gorm.DB, error)

初始化数据库

Types

type UmsAdmin

type UmsAdmin struct {
	Id         uint      `json:"id" gorm:"primaryKey"`
	Username   string    `json:"username"`
	Password   string    `json:"-"`
	Icon       string    `json:"icon"`
	Email      string    `json:"email"`
	NickName   string    `json:"nick_name"`
	Note       string    `json:"note"`
	CreateTime time.Time `json:"create_time"`
	// 设置gorm tag.这样调用create() 方法的时候,如果当前字段为零值会自动过滤掉
	LoginTime time.Time `json:"login_time" gorm:"default:null"`
	Status    uint8     `json:"status" gorm:"default:1"`
}

func (*UmsAdmin) BeforeCreate

func (a *UmsAdmin) BeforeCreate(tx *gorm.DB) (err error)

func (*UmsAdmin) TableName

func (a *UmsAdmin) TableName() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL