validates

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(dataStruct interface{}) (err error)

Validate 全局model数据验证器 @param 接收一个待数据验证的结构体 @return err 返回错误信息

Types

type ListValidate

type ListValidate struct {
	Page     uint   `json:"page" validate:"numeric" label:"页码"`
	PageSize uint   `json:"pageSize" validate:"numeric" label:"每页大小"`
	Keywords string `json:"keywords" validate:"omitempty,max=20" label:"每页大小"`
}

ListValidate 管理员列表验证规则

type Validates

type Validates struct {
	Validate interface{}
}

Validates 全局验证器

func (Validates) Check

func (base Validates) Check(data map[string]interface{}) (toMap map[string]interface{})

Check 验证方法 @param map[string]interface{} data 待验证数据 @return void

Directories

Path Synopsis
common

Jump to

Keyboard shortcuts

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