req

package
v0.0.0-...-4271f97 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Validator binding.StructValidator = &defaultValidator{}

Functions

func Bind

func Bind(c *gin.Context, obj any) error

func ShouldBind

func ShouldBind(c *gin.Context, obj any) error

Types

type AuthLoginReq

type AuthLoginReq struct {
	Captcha
	Account  string `json:"account" form:"account" binding:"required"`
	Password string `json:"password" form:"password" binding:"required"`
}

type AuthPasswordReq

type AuthPasswordReq struct {
	OldPassword string `json:"old_password" form:"old_password" binding:"required"`
	NewPassword string `json:"new_password" form:"new_password" binding:"required"`
	Confirm     string `json:"confirm" form:"confirm" binding:"required"`
}

type AuthResetReq

type AuthResetReq struct {
	Password string `json:"password" form:"password" binding:"required"`
	Confirm  string `json:"confirm" form:"confirm" binding:"required"`
}

type Captcha

type Captcha struct {
	UUID string `json:"uuid" form:"uuid" binding:"required"`
	Code string `json:"code" form:"code" binding:"required"`
}

type ConfirmReq

type ConfirmReq struct {
	Confirm bool `json:"confirm" form:"confirm" binding:"required"`
}

type IDReq

type IDReq struct {
	ID string `json:"id" yaml:"id" form:"id" uri:"id" binding:"required"`
}

type LikeReq

type LikeReq struct {
	Keyword string `json:"keyword" form:"keyword"`
}

type NameReq

type NameReq struct {
	Name string `form:"name" uri:"name" json:"name" binding:"required"`
}

type PaginationReq

type PaginationReq struct {
	Page int `json:"page" form:"page"`
	Size int `json:"size" form:"size"`
}

func (*PaginationReq) FindPage

func (p *PaginationReq) FindPage(sizeLimit ...int) (offset int, limit int)

func (*PaginationReq) StartEnd

func (p *PaginationReq) StartEnd() (start, end int)

Jump to

Keyboard shortcuts

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