gin_handler

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StatusOKCode  = http.StatusOK
	ErrCode       = http.StatusBadRequest
	ErrResultCode = http.StatusBadRequest
	BindErrCode   = http.StatusBadRequest
)
View Source
var AbortWithBindErr = abortWithBindErr
View Source
var AbortWithErr = abortWithErr

Functions

func HandlerFunc

func HandlerFunc(hd interface{}, b binding.Binding) gin.HandlerFunc

func JSON added in v0.0.4

func JSON(hd interface{}) gin.HandlerFunc

注册POST,PUT,DELETE请求获取 JsonBody

func Query

func Query(hd interface{}) gin.HandlerFunc

注册Get请求获取 ? 之后的参数

Types

type RestResult

type RestResult struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

func ErrResult

func ErrResult(message ...string) RestResult

func ErrResultWithErr

func ErrResultWithErr(err error) RestResult

func Success

func Success(message ...string) RestResult

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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