param

package
v0.0.0-...-92ef796 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindRouteId

func BindRouteId(c *gin.Context, field string) (int32, bool)

make sure id is greater than 0

Types

type FriendParam

type FriendParam struct {
	Uid int32 `form:"to" json:"to" binding:"required,gte=1"`
}

@Model FriendParam @Description Friend parameter @Property to integer true "friend uid"

type LoginParam

type LoginParam struct {
	Username string `form:"username" json:"username" binding:"required"`
	Password string `form:"password" json:"password" binding:"required"`
	Expire   int64  `form:"expire"   json:"expire"`
}

@Model LoginParam @Description Login parameter @Property username string true "username" @Property password string true "password" @Property expire integer false "login expire" (default:604800)

type MessageParam

type MessageParam struct {
	Message string `form:"message" json:"message" binding:"required"`
}

type PageOrderParam

type PageOrderParam struct {
	*PageParam
	Order string
}

func BindPageOrder

func BindPageOrder(c *gin.Context, config *config.ServerConfig) *PageOrderParam

type PageParam

type PageParam struct {
	Page  int32
	Limit int32
}

func BindPage

func BindPage(c *gin.Context, config *config.ServerConfig) *PageParam

type PassParam

type PassParam struct {
	Password string `form:"password" json:"password" binding:"required,min=8,max=30,pwd"`
}

@Model PassParam @Description Update password parameter @Property password string true "password, length between [5, 30]"

type RegisterParam

type RegisterParam struct {
	Username string `form:"username" json:"username" binding:"required,min=5,max=30,name"`
	Password string `form:"password" json:"password" binding:"required,min=8,max=30,pwd"`
}

@Model RegisterParam @Description Register parameter @Property username string true "username, length between [5, 30]" @Property password string true "password, length between [8, 30]"

type UserParam

type UserParam struct {
	Username string `form:"username" json:"username" binding:"required,min=5,max=30,name"`
}

@Model UserParam @Description Update user parameter @Property username string true "username, length between [5, 30]"

Jump to

Keyboard shortcuts

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