Router2Params

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(context any, params interface{}) (b bool)

CheckJSON 单纯过滤数据

func GetID

func GetID(context any) (int64, bool)

GetID 获取参数带有ID的头

func GetIDByName

func GetIDByName(context any, name string) (int64, bool)

GetIDByName 获取指定的ID数据

func GetIDByNameNoErr

func GetIDByNameNoErr(context any, name string) (int64, bool)

func GetInt64ByName

func GetInt64ByName(context any, name string) (int64, bool)

GetInt64ByName 获取指定的Int64数据

func GetJSON

func GetJSON(context any, params interface{}) (b bool)

GetJSON 获取和验证参数

func GetMark

func GetMark(context any) (string, bool)

func GetMarkByName

func GetMarkByName(context any, name string) (string, bool)

Types

type ActionIDAndUserType

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

func GetActionIDAndUser

func GetActionIDAndUser(context any) (ActionIDAndUserType, bool)

type ActionIDType

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

ActionIDType 常见action类动作请求参数头

func GetActionID

func GetActionID(context any) (ActionIDType, bool)

GetActionID 获取参数头

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(context any) (ParamsListType, bool)

Jump to

Keyboard shortcuts

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