model

package
v0.0.0-...-c1e3cba Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PasswordCost        = 12       // 密码加密难度
	Active       string = "active" // 激活用户
)

Variables

View Source
var DB *gorm.DB

Functions

func DataBase

func DataBase(dsn string)

Types

type User

type User struct {
	gorm.Model
	NickName       string `gorm:"unique"`
	PasswordDigest string
	Email          string
	Avatar         string `gorm:"size:1000"`
	Phone          string
	Status         string
}

func (*User) AvatarURL

func (user *User) AvatarURL() string

AvatarURL 封面地址

func (*User) CheckPassword

func (user *User) CheckPassword(password string) bool

CheckPassword 校验密码

func (*User) SetPassword

func (user *User) SetPassword(password string) error

SetPassword 设置密码

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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