response

package
v0.0.0-...-f15947d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Biz

func Biz(c *gin.Context, code int, msg string, data interface{})

Biz 业务错误

func Error

func Error(c *gin.Context, code int)

Error 服务端错误

func ErrorErr

func ErrorErr(c *gin.Context, err error)

func ErrorParam

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

ErrorParam 参数校验错误

func Fail

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

Fail 失败的业务逻辑

func Redirect

func Redirect(c *gin.Context, url string)

Redirect 重定向

func ReturnJson

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

func ReturnJsonFromString

func ReturnJsonFromString(c *gin.Context, httpCode int, jsonStr string)

ReturnJsonFromString 将json字符窜以标准json格式返回(例如,从redis读取json格式的字符串,返回给浏览器json格式)

func Success

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

Success 直接返回成功

func Unauthorized

func Unauthorized(c *gin.Context, code int)

Unauthorized 未授权

Types

This section is empty.

Jump to

Keyboard shortcuts

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