request

package
v0.0.0-...-2f55e15 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetErrorMsg

func GetErrorMsg(request interface{}, err error) string

GetErrorMsg 获取错误信息

Types

type ImageUpload

type ImageUpload struct {
	Business string                `form:"business" json:"business" binding:"required"`
	Image    *multipart.FileHeader `form:"image" json:"image" binding:"required"`
}

func (ImageUpload) GetMessages

func (imageUpload ImageUpload) GetMessages() ValidatorMessages

type Login

type Login struct {
	Mobile   string `form:"mobile" json:"mobile" binding:"required,mobile"`
	Password string `form:"password" json:"password" binding:"required"`
}

func (Login) GetMessages

func (login Login) GetMessages() ValidatorMessages

type Register

type Register struct {
	Name     string `form:"name" json:"name" binding:"required"`
	Mobile   string `form:"mobile" json:"mobile" binding:"required,mobile"`
	Password string `form:"password" json:"password" binding:"required"`
}

func (Register) GetMessages

func (register Register) GetMessages() ValidatorMessages

type Validator

type Validator interface {
	GetMessages() ValidatorMessages
}

type ValidatorMessages

type ValidatorMessages map[string]string

Jump to

Keyboard shortcuts

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