validates

package
v0.0.0-...-3c02317 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Validate      *validator.Validate
	ValidateTrans ut.Translator
)

表单验证 https://github.com/go-playground/validator

Functions

This section is empty.

Types

type CreateUpdateUserRequest

type CreateUpdateUserRequest struct {
	Username string `json:"username" validate:"required,gte=2,lte=50" comment:"用户名"`
	Password string `json:"password" validate:"required"  comment:"密码"`
	Name     string `json:"name" validate:"required,gte=2,lte=50"  comment:"名称"`
	RoleIds  []uint `json:"role_ids"  validate:"required" comment:"角色"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" validate:"required,gte=2,lte=50" comment:"用户名"`
	Password string `json:"password" validate:"required"  comment:"密码"`
}

type PermissionRequest

type PermissionRequest struct {
	Name        string `json:"name" validate:"required,gte=4,lte=50" comment:"名称"`
	DisplayName string `json:"display_name" comment:"显示名称"`
	Description string `json:"description" comment:"描述"`
	Act         string `json:"act" comment:"Act"`
}

type RoleRequest

type RoleRequest struct {
	Name           string `json:"name" validate:"required,gte=4,lte=50" comment:"名称"`
	DisplayName    string `json:"display_name" comment:"显示名称"`
	Description    string `json:"description" comment:"描述"`
	PermissionsIds []uint `json:"permissions_ids" comment:"权限"`
}

Jump to

Keyboard shortcuts

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