models

package
v0.0.0-...-6019785 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OAuth2Bytes

func OAuth2Bytes(authToken *OAuthToken) []byte

func UserCheckLogin

func UserCheckLogin(username string, password string) bool

*

  • 用户登录校验
  • @method UserCheckLogin
  • @param [string] username [用户账号]
  • @param [string] password [用户密码(加密)]

Types

type OAuthToken

type OAuthToken struct {
	Token        string
	Expiration   string
	ClientId     string
	Username     string
	TokenType    string
	TokenScope   string
	RefreshToken string
}

func Bytes2OAuth

func Bytes2OAuth(b []byte) *OAuthToken

func (*OAuthToken) IsTokenExpired

func (token *OAuthToken) IsTokenExpired() bool

*

  • 用户Token是否失效
  • @method IsTokenExpired
  • @param OAuthToken token [保存的TokenObject]

type UserInfo

type UserInfo struct {
	ID        uint64    `gorm:"primary_key AUTO_INCREMENT COMMENT '主键,自动生成'"`
	Account   string    `gorm:"not null VARCHAR(50) COMMENT '用户账号'"`
	Password  string    `gorm:"not null VARCHAR(50) COMMENT '用户密码'"`
	Nickname  string    `gorm:"VARCHAR(500) COMMENT '用户昵称'"`
	Signature string    `gorm:"VARCHAR(50) COMMENT '用户签名'"`
	Mail      string    `gorm:"VARCHAR(50) COMMENT '用户邮箱'"`
	Mobile    string    `gorm:"VARCHAR(50) COMMENT '用户电话'"`
	AddTime   time.Time `gorm:"COMMENT '创建时间'"`
	EditTime  time.Time `gorm:"COMMENT '更新时间'"`
	DelFlag   uint32    `gorm:"COMMENT '删除标志位'"`
}

Jump to

Keyboard shortcuts

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