controller

package
v0.0.0-...-93b8502 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	errors.Error
}

func (*Api) Err

func (api *Api) Err(c *gin.Context, e error)

Err 判断错误类型是自定义类型则自动返回错误中携带的code和message,否则返回服务器错误

func (*Api) Fail

func (api *Api) Fail(c *gin.Context, code int, message string, data ...interface{})

Fail 业务失败响应

func (*Api) FailCode

func (api *Api) FailCode(c *gin.Context, code int, data ...interface{})

FailCode 业务失败响应

func (*Api) Success

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

Success 业务成功响应

Directories

Path Synopsis
v1
ws

Jump to

Keyboard shortcuts

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