response

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2024 License: MIT Imports: 1 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SuccessMessage     = "操作成功"
	FailMessage        = "操作失败"
	SuccessCode        = 200
	FailCode           = 400
	ParameterCodeError = 422
	ParameterError     = "参数错误"
)

Functions

func HttpFail

func HttpFail(ctx *gin.Context, data ...interface{})

func HttpFailWithCodeAndMessage

func HttpFailWithCodeAndMessage(code int, message string, ctx *gin.Context, data ...interface{})

func HttpFailWithErr

func HttpFailWithErr(ctx *gin.Context, data ...error)

func HttpFailWithMessage

func HttpFailWithMessage(ctx *gin.Context, message string, data ...interface{})

func HttpFailWithParameter

func HttpFailWithParameter(ctx *gin.Context, data ...interface{})

func HttpOk

func HttpOk(ctx *gin.Context, data ...interface{})

func HttpOkWithMessage

func HttpOkWithMessage(ctx *gin.Context, message string, data ...interface{})

func HttpParameterError

func HttpParameterError(ctx *gin.Context, err error)

func HttpSuccessWithError

func HttpSuccessWithError(ctx *gin.Context, err error, Data interface{})

func ReturnCode

func ReturnCode(ctx *gin.Context, StatusCode int, Message string, Data interface{})

Types

type Response

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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