result

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CODE_SUCCESS code = "0"
	CODE_FAIL    code = "1"
)

Variables

This section is empty.

Functions

func FailDataMsg

func FailDataMsg(c *gin.Context, data interface{}, err error)

FailDataMsg *

  • @Description: 返回带消息和数据的失败
  • @param c
  • @param data
  • @param err

func FailMsg

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

FailMsg *

  • @Description: 返回带消息的失败
  • @param c
  • @param err

func File

func File(c *gin.Context, fileName, filePath string)

File *

  • @Description: 返回文件
  • @param c
  • @param fileName
  • @param filePath

func OkDataMsg

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

OkDataMsg *

  • @Description: 返回带消息和数据的成功
  • @param c
  • @param data
  • @param message

func OkMsg

func OkMsg(c *gin.Context, message string)

OkMsg *

  • @Description: 返回带消息的成功
  • @param c
  • @param message

func Result

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

Result *

  • @Description: Gin统一返回结果
  • @param code
  • @param data
  • @param message
  • @param c

Types

type Response

type Response struct {
	Code    code        `json:"code"`
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
}

Jump to

Keyboard shortcuts

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