response

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RequestStatusOkCode   int    = 1
	RequestStatusOkMsg    string = "Success"
	RequestStatusFailCode int    = 0
	RequestStatusFailMsg  string = "Failed"

	ErrorsNoAuthorization    string = "token鉴权未通过,请通过token授权接口重新获取token,"
	ValidatorParamsCheckFail string = "请求参数错误"
)

Variables

This section is empty.

Functions

func ErrorAuthFail

func ErrorAuthFail(c *gin.Context)

ErrorAuthFail 权限校验失败

func ErrorParam

func ErrorParam(c *gin.Context, wrongParam interface{})

ErrorParam 参数校验失败

func Fail

func Fail(c *gin.Context, dataCode int, msg interface{}, data interface{})

Fail 失败的业务逻辑

func ReturnJson

func ReturnJson(c *gin.Context, httpCode int, dataCode int, msg interface{}, data interface{}, success bool)

func Success

func Success(c *gin.Context, dataCode int, msg interface{}, data interface{})

Success 直接返回成功

Types

This section is empty.

Jump to

Keyboard shortcuts

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