model

package
v0.0.0-...-cc62b12 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultAdminUserAlias = "Administrator"

DefaultAdminUserAlias default admin user alias

View Source
const DefaultAdminUserName = "admin"

DefaultAdminUserName default admin user name

Variables

This section is empty.

Functions

func RegisterModel

func RegisterModel(models ...Interface)

RegisterModel register model

Types

type BaseModel

type BaseModel struct {
	CreateTime time.Time `json:"createTime"`
	UpdateTime time.Time `json:"updateTime"`
}

func (*BaseModel) SetCreateTime

func (m *BaseModel) SetCreateTime(time time.Time)

SetCreateTime set create time

func (*BaseModel) SetUpdateTime

func (m *BaseModel) SetUpdateTime(time time.Time)

SetUpdateTime set update time

type Interface

type Interface interface {
	TableName() string
	ShortTableName() string
}

type User

type User struct {
	BaseModel
	Name          string    `json:"name"`
	Password      string    `json:"password,omitempty"`
	Disabled      bool      `json:"disabled"`
	LastLoginTime time.Time `json:"lastLoginTime,omitempty"`
}

User is the model of user

func (*User) Index

func (u *User) Index() map[string]string

Index return custom index

func (*User) PrimaryKey

func (u *User) PrimaryKey() string

PrimaryKey return custom primary key

func (*User) ShortTableName

func (u *User) ShortTableName() string

func (*User) TableName

func (u *User) TableName() string

Jump to

Keyboard shortcuts

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