models

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown = common.Unknown
	Male    = common.Male
	Female  = common.Female
)

Variables

View Source
var (
	ByUid = By(func(p1, p2 *Staff) bool {
		return p1.UID < p2.UID
	})
)
View Source
var (
	VerifyLifeSeconds = 86400
)

Functions

func HashCode

func HashCode(code string) int64

func SplitName

func SplitName(cn string) (sn, gn string)

SplitName 分隔姓名,使用 "·" " "

Types

type By

type By func(p1, p2 *Staff) bool

By is the type of a "less" function that defines the ordering of its Staff arguments.

func (By) Sort

func (by By) Sort(staffs Staffs)

Sort is a method on the function type, By, that sorts the argument slice according to the function.

type Gender

type Gender = common.Gender

type Spec added in v0.10.5

type Spec = schema.Spec

type Staff

type Staff = schema.People

type Staffs added in v0.8.4

type Staffs = schema.Peoples

type Verify

type Verify struct {
	Id          int              `db:"id" json:"id"`
	Uid         string           `db:"uid" json:"uid"`
	Target      string           `db:"target" json:"target"`
	Type        common.AliasType `db:"type_id" json:"type"`
	CodeHash    int64            `db:"code_hash" json:"-"`
	LifeSeconds int              `db:"life_seconds" json:"life_seconds"`
	Created     time.Time        `db:"created" json:"created"`
	Updated     time.Time        `db:"updated" json:"updated"`

	Code string `db:"-" json:"-"`
}

用户验证,如邮箱、手机等

func NewVerify

func NewVerify(at common.AliasType, target, uid string) *Verify

func (*Verify) CodeHashBytes

func (uv *Verify) CodeHashBytes() []byte

func (*Verify) IsExpired

func (uv *Verify) IsExpired() bool

func (*Verify) Match

func (uv *Verify) Match(code string) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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