helper

package
v1.0.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 11 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(
	UserHelperSet,
)

ProviderSet is helper providers.

View Source
var UserHelperSet = wire.NewSet(wire.Struct(new(UserHelper), "*"))

Functions

This section is empty.

Types

type UserHelper

type UserHelper struct {
	DB  *model.Client
	Log *log.Helper
	JWT *jwt.LoginCheck
}

func (*UserHelper) CreateToken

func (h *UserHelper) CreateToken(userInfo *model.User) (string, error)

CreateToken 根据用户信息创建token

func (*UserHelper) CreateUser

func (h *UserHelper) CreateUser(ctx context.Context, email, password string) (*model.User, error)

CreateUser 创建用户

func (*UserHelper) FindByAccount

func (h *UserHelper) FindByAccount(ctx context.Context, account string) *model.User

FindByAccount 根据账号查找用户

func (*UserHelper) FindEmailDetail

func (h *UserHelper) FindEmailDetail(ctx context.Context, email string) *model.UserEmail

func (*UserHelper) SetUserPassword

func (h *UserHelper) SetUserPassword(ctx context.Context, userInfo *model.User, password string) error

SetUserPassword 设置用户密码

func (*UserHelper) SetUserSecondAuth

func (h *UserHelper) SetUserSecondAuth(ctx context.Context, userInfo *model.User, val bool) error

SetUserSecondAuth 设置必须验证 遇到密码输入错误等安全情况需要强制二次验证

func (*UserHelper) SumSignature

func (h *UserHelper) SumSignature(userInfo *model.User) string

SumSignature get admin data signature

func (*UserHelper) ValidatePassword

func (h *UserHelper) ValidatePassword(userInfo *model.User, password string) error

ValidatePassword 验证用户密码

Jump to

Keyboard shortcuts

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