validation

package
v0.0.0-...-654a53c Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticatedAccount

func AuthenticatedAccount(context *gin.Context, user *domain.Account) bool

代表用户必须与当前登陆的用户一致

func NotConflictAccount

func NotConflictAccount(context *gin.Context, user *domain.Account) bool

表示一个用户的信息是无冲突的 “无冲突”是指该用户的敏感信息与其他用户不重合,譬如将一个注册用户的邮箱,修改成与另外一个已存在的注册用户一致的值,这便是冲突

func RunAccountValidation

func RunAccountValidation(context *gin.Context, user *domain.Account, types []TypeAccount) bool

func UniqueAccount

func UniqueAccount(context *gin.Context, user *domain.Account) bool

表示一个用户是唯一的 唯一不仅仅是用户名,还要求手机、邮箱均不允许重复

Types

type TypeAccount

type TypeAccount int
const (
	NotConflict TypeAccount = iota
	Authenticated
	Unique
)

Jump to

Keyboard shortcuts

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