app

package
v0.0.0-...-76b4d0c Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarkError

func MarkError(v ...interface{})

MarkError 将错误 存入日志

Types

type Gin

type Gin struct {
	C *gin.Context
}

Gin 实体

func GetGin

func GetGin(c *gin.Context) Gin

GetGin 获取Gin

func (*Gin) Response

func (g *Gin) Response(httpCode, errCode int, data interface{})

Response 返回的数据

func (*Gin) ResponseFail

func (g *Gin) ResponseFail()

ResponseFail 返回失败

func (*Gin) ResponseFailErrCode

func (g *Gin) ResponseFailErrCode(errCode int)

ResponseFailErrCode 返回失败

func (*Gin) ResponseFailError

func (g *Gin) ResponseFailError(error util.Error)

ResponseFailError 返回自定义的错误类型

func (*Gin) ResponseFailValidParam

func (g *Gin) ResponseFailValidParam(err error)

ResponseFailValidParam 验证参数错误

func (*Gin) ResponseSuc

func (g *Gin) ResponseSuc(data interface{})

ResponseSuc 返回成功

type HTTPSuccess

type HTTPSuccess struct {
	Code    int    `json:"code" example:"200"`
	Message string `json:"msg" example:"ok" `
	Data    string `json:"data" example:"null"`
}

Jump to

Keyboard shortcuts

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