RouterParams

package
v5.1.34 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckJSON

func CheckJSON(c *gin.Context, params interface{}) (b bool)

CheckJSON 单纯过滤数据

func GetID

func GetID(c *gin.Context) (int64, bool)

GetID 获取参数带有ID的头

func GetIDByName

func GetIDByName(c *gin.Context, name string) (int64, bool)

GetIDByName 获取指定的ID数据

func GetIDByNameNoErr

func GetIDByNameNoErr(c *gin.Context, name string) (int64, bool)

func GetJSON

func GetJSON(c *gin.Context, params interface{}) (b bool)

GetJSON 获取和验证参数

func GetMark

func GetMark(c *gin.Context) (string, bool)

Types

type ActionIDAndUserType

type ActionIDAndUserType struct {
	ID     int64 `json:"id"`
	UserID int64 `json:"userID"`
}

func GetActionIDAndUser

func GetActionIDAndUser(c *gin.Context) (ActionIDAndUserType, bool)

type ActionIDType

type ActionIDType struct {
	ID int64 `json:"id"`
}

常见action类动作请求参数头

func GetActionID

func GetActionID(c *gin.Context) (ActionIDType, bool)

获取参数头

type ParamsListType

type ParamsListType struct {
	Page   int64  `json:"page" check:"page"`
	Max    int64  `json:"max" check:"max"`
	Sort   string `json:"sort" check:"sort"`
	Desc   bool   `json:"desc" check:"desc"`
	Search string `json:"search" check:"search" empty:"true"`
}

func GetDataList

func GetDataList(c *gin.Context) (ParamsListType, bool)

Jump to

Keyboard shortcuts

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