user

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 3 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 {
	model.BaseModel
	Name string `gorm:"column:name;type:varchar(255);not null;unique" valid:"name"`
	//Email    string `gorm:"column:email;type:varchar(255) not null;unique" valid:"email"`
	Password string `gorm:"column:password;type:varchar(255);not null" valid:"password"`
}

func CreateUser

func CreateUser(name, password string) (user *User, err error)

CreateUser 创建用户

func GetByName

func GetByName(name string) (user *User, err error)

GetByName 根据名称获取用户

func (*User) BeforeSave

func (user *User) BeforeSave(tx *gorm.DB) (err error)

BeforeSave 保存前

func (*User) ComparePassword

func (user *User) ComparePassword(_password string) bool

ComparePassword 检查密码是否匹配

Jump to

Keyboard shortcuts

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