response

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

View Source
const Tocamel = "toCamel"

Variables

This section is empty.

Functions

func ErrorCasbinAuthFail

func ErrorCasbinAuthFail(c *gin.Context, msg interface{})

ErrorCasbinAuthFail 鉴权失败,返回 405 方法不允许访问

func ErrorForbidden

func ErrorForbidden(c *gin.Context)

ErrorForbidden token 权限身份校验失败

func ErrorParam

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

ErrorParam 参数校验错误

func ErrorServiceForbidden

func ErrorServiceForbidden(c *gin.Context)

func ErrorSystem

func ErrorSystem(c *gin.Context, msg string, data interface{})

ErrorSystem 系统执行代码错误

func ErrorTokenAuthFail

func ErrorTokenAuthFail(c *gin.Context)

ErrorTokenAuthFail token 权限校验失败

func ErrorTokenBaseInfo

func ErrorTokenBaseInfo(c *gin.Context)

ErrorTokenBaseInfo token 基本的格式错误

func ErrorTokenRefreshFail

func ErrorTokenRefreshFail(c *gin.Context)

ErrorTokenRefreshFail token不符合刷新条件

func ErrorTooManyRequests

func ErrorTooManyRequests(c *gin.Context)

StatusTooManyRequests 请求过于频繁

func Fail

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

Fail 失败的业务逻辑

func GetToCamel

func GetToCamel(c *gin.Context) bool

func ReturnJson

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

func ReturnJsonFromString

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

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

func S

func S(c *gin.Context)

语法糖函数封装

func SetToCamel

func SetToCamel(c *gin.Context)

func Success

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

Success 直接返回成功

func TokenErrorParam

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

TokenErrorParam 参数校验错误

func ValidatorError

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

ValidatorError 翻译表单参数验证器出现的校验错误

Types

This section is empty.

Jump to

Keyboard shortcuts

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