apis

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct{}

func (*Api) Bind

func (e *Api) Bind(ctx *gin.Context, req interface{}) error

func (Api) Custom

func (e Api) Custom(c *gin.Context, data gin.H)

Custom 兼容函数

func (Api) Error

func (e Api) Error(c *gin.Context, err error)

Error 通常错误数据处理

func (Api) ErrorC

func (e Api) ErrorC(c *gin.Context, code int, msg string)

ErrorC 通常错误数据处理

func (Api) OK

func (e Api) OK(c *gin.Context, data interface{})

OK 通常成功数据处理

func (Api) PageOK

func (e Api) PageOK(c *gin.Context, result interface{}, count int64, pageIndex int, pageSize int)

PageOK 分页数据处理

func (Api) ParamError added in v1.0.1

func (e Api) ParamError(c *gin.Context, err error)

func (*Api) ShouldBindWith added in v1.0.11

func (e *Api) ShouldBindWith(ctx *gin.Context, d interface{}, bindings ...binding.Binding) error

Bind 参数校验

type IError

type IError interface {
	Code() int
	Error() string
}

type NApi

type NApi struct {
	Api
}

type ValidI added in v1.0.3

type ValidI interface {
	Valid() error
}

Jump to

Keyboard shortcuts

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