models

package
v0.0.0-...-9b663ca Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	base.DefaultModel
	Name      string    `gorm:"size:50;unique;NOT NULL;comment:姓名;"`
	Password  string    `gorm:"size:256;NOT NULL;comment:密码"`
	Avatar    string    `gorm:"size:200;NOT NULL;comment:头像"`
	RoleID    int       `gorm:"comment:角色"` //用户角色,1:owner,2:manager,3:normal user,4: guest
	Gender    int       `gorm:"comment:性别"` //性别,0:male,1:female,2:unknown
	Color     string    `gorm:"comment:颜色"` //favorite color
	BirthDate time.Time `gorm:"comment:出生年月"`
	IP        string    `gorm:"size:50;NOT NULL;comment:ip地址"` //check if user is online
}

User 用户

func NewUser

func NewUser() *User

NewUser ..

func (*User) GenerateAdminAccount

func (m *User) GenerateAdminAccount(ownerName, ownerPassword string)

GenerateAdminAccount ..

func (*User) MarshalBinary

func (m *User) MarshalBinary() ([]byte, error)

MarshalBinary ..

func (*User) TableName

func (m *User) TableName() string

TableName ..

func (*User) UnmarshalBinary

func (m *User) UnmarshalBinary(data []byte) error

UnmarshalBinary ..

Jump to

Keyboard shortcuts

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