model

package
v0.0.0-...-3576a75 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseClaims

type BaseClaims struct {
	Id       int64
	Account  string
	Username string
	Role     string
}

BaseClaims 声明用于在 JWT 中携带用户相关的信息

type CustomClaims

type CustomClaims struct {
	BaseClaims
	BufferTime int64
	jwt.RegisteredClaims
}

type JwtBlacklist

type JwtBlacklist struct {
	Model
	Jwt string `gorm:"type:text;comment:jwt"`
}

type Model

type Model struct {
	CreateTime time.Time `db:"create_time" json:"-"`
	UpdateTime time.Time `db:"update_time" json:"-"`
	IsDelete   int8      `db:"is_delete" json:"-"`
}

Model 全局的实体属性

type User

type User struct {
	Id       int64  `db:"id" json:"id"`
	Account  string `db:"account" json:"account"`
	Username string `db:"username" json:"username"`
	Password string `db:"password" json:"-"`
	Avatar   string `db:"avatar" json:"avatar"`
	Email    string `db:"email" json:"email"`
	Phone    string `db:"phone" json:"phone"`
	Profile  string `db:"profile" json:"profile"`
	Gender   int8   `db:"gender" json:"gender"`
	Role     string `db:"role" json:"role"`
	Model
}

func NewUser

func NewUser(account, password string) *User

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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