app

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest added in v0.2.0

func BadRequest(c *gin.Context, errCode int, err ...error)

BadRequest bad request response 返回错误参数请求

func BizFailed

func BizFailed(c *gin.Context, errCode int, err ...error)

BizFailed business failed response 返回业务逻辑失败

func Forbidden added in v1.0.0

func Forbidden(c *gin.Context, errCode int, err ...error)

Forbidden authorized forbidden response 返回被禁止访问

func HttpResponse

func HttpResponse(c *gin.Context, httpCode int, msgCode int, data interface{})

HttpResponse common response 返回通用

func ServerFailed

func ServerFailed(c *gin.Context, errCode int, err ...error)

ServerFailed server internal failed response 返回服务器内部故障

func Success

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

Success response a success 返回成功

func Unauthorized

func Unauthorized(c *gin.Context, errCode int, err ...error)

Unauthorized authorized failed response 返回权限不足

Types

type ApiJson

type ApiJson struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

type ErrJson

type ErrJson struct {
	Err []string `json:"err"`
}

Directories

Path Synopsis
e

Jump to

Keyboard shortcuts

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