res

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success             = iota * 100
	InvalidParameter          // 参数错误
	MissingParameter          // 参数缺损
	InvalidToken              // token 失效
	BadRequest                // 无效的访问
	Unauthorized        = 401 // 未授权
	NotFound            = 404 // 空数据
	InternalServerError = 500 // 内部服务器错误
)

Variables

This section is empty.

Functions

func ErrAuth

func ErrAuth(c *gin.Context, msgs ...string)

func ErrBadRequest

func ErrBadRequest(c *gin.Context, msgs ...string)

func ErrNotFound

func ErrNotFound(c *gin.Context, msgs ...string)

func ErrParams

func ErrParams(c *gin.Context, msgs ...string)

func ErrParamsMissing

func ErrParamsMissing(c *gin.Context, msgs ...string)

func ErrToken

func ErrToken(c *gin.Context, msgs ...string)

func Failed

func Failed(c *gin.Context, msg string)

func OK

func OK(c *gin.Context, msg string, datas ...interface{})

func Result

func Result(c *gin.Context, ret int, msg string, datas ...interface{})

Types

type ResultBody

type ResultBody struct {
	TraceId string      `json:"trace_id"`
	Ret     int         `json:"ret"`
	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