middleware

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode       = 10
	ErrorCode         = 20
	ErrorUnAuthCode   = 21
	InternalErrorCode = 500
)

1000以下为通用码,1000以上为用户自定义码

Variables

This section is empty.

Functions

func ResponseError

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

func ResponseErrorCode added in v1.0.6

func ResponseErrorCode(ctx *gin.Context, code int, err error)

func ResponseSuccess

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

智能识别 参数

Types

type Response

type Response struct {
	Status int         `json:"status"`
	Msg    string      `json:"msg"`
	Data   interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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