httpx

package
v0.0.0-...-50c9059 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: GPL-3.0 Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetDefaultRespJSON

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

func SetDefaultRespJSONPaged

func SetDefaultRespJSONPaged(c *gin.Context, data interface{}, total int64)

func SetRespErr

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

func SetRespJSON

func SetRespJSON(c *gin.Context, data interface{}, message string)

func SetRespJSONPaged

func SetRespJSONPaged(c *gin.Context, data interface{}, message string, total int64)

Types

type JSONResult

type JSONResult struct {
	Code    int         `json:"code"`                      // 回包code,表明是否正确,在code == 0时,表明服务正常
	Message string      `json:"message" example:"success"` // 回报message,在code != 0时,展示给前端
	Data    interface{} `json:"data"`                      // 数据
}

func MakeResultWithError

func MakeResultWithError(err errorx.IError) *JSONResult

type JSONResultPaged

type JSONResultPaged struct {
	Code    int         `json:"code"`                      // 回包code,表明是否正确,在code == 0时,表明服务正常
	Message string      `json:"message" example:"success"` // 回报message,在code != 0时,展示给前端
	Data    interface{} `json:"data"`                      // 数据
	Total   int64       `json:"total"`                     // 总数量
}

Jump to

Keyboard shortcuts

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