models

package
Version: v0.0.0-...-e31a138 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	ID        uint `gorm:"primary_key;AUTO_INCREMENT"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
}

type User

type User struct {
	Model
	UserName string `gorm:"not null;default:'';comment:'用户名'"`
	Password string `gorm:"not null;default:'';comment:'密码'"`
	Avatar   string `gorm:"not null;default:'';comment:'头像'"`
	Email    string `gorm:"not null;default:'';comment:'手机号'"`
	Mobile   string `gorm:"not null;default:'';comment:'手机号'"`
	Sex      int    `gorm:"not null;default:0;comment:'性别:1=》男;2=》女;0=》未知'"`
	Status   int    `gorm:"not null;default:0;comment:'登录状态:0=》初始;1=》允许登录;2=》禁止登录'"`
}

func (User) TableName

func (User) TableName() string

func (User) UserCreate

func (u User) UserCreate() (user User, err error)

func (User) UserInfo

func (u User) UserInfo(field string, value string) (user User, err error)

func (User) UserList

func (u User) UserList(params map[string]interface{}) (users []User, err error)

Source Files

Jump to

Keyboard shortcuts

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