gin_resp

package
v1.0.29 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(ctx *gin.Context, fn ...RespFn)

*@Author Administrator *@Date 29/4/2021 15:39 *@desc

func ParameterError

func ParameterError(ctx *gin.Context, fn ...RespFn)

*@Author Administrator *@Date 29/4/2021 15:16 *@desc 参数错误

func ServerError

func ServerError(ctx *gin.Context, fn ...RespFn)

*@Author Administrator *@Date 29/4/2021 15:19 *@desc ServerError 服务器错误

func Success

func Success(ctx *gin.Context, fn ...RespFn)

*@Author Administrator *@Date 29/4/2021 15:34 *params Code 默认200 Message 默认success Data 默认nil *@desc Success 操作成功

Types

type GinResp

type GinResp struct {
	StatusCode int         `json:"statusCode"`
	Message    string      `json:"message"`
	Data       interface{} `json:"data"`
}

type RespFn

type RespFn func(resp *GinResp)

func Code

func Code(code int) RespFn

*@Author Administrator *@Date 29/4/2021 15:16 *@desc

func Data

func Data(data interface{}) RespFn

*@Author Administrator *@Date 29/4/2021 15:16 *@desc

func Message

func Message(msg string) RespFn

*@Author Administrator *@Date 29/4/2021 15:16 *@desc

Jump to

Keyboard shortcuts

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