response

package
v0.0.0-...-dae8c3a Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const CodeErr = 500

CodeErr 错误代码

View Source
const CodeSuccess = 200

CodeSuccess 成功代码

View Source
const MessageErr = "Internal Server Error"

MessageErr 错误消息

View Source
const MessageSuccess = ""

MessageSuccess 成功消息

Variables

This section is empty.

Functions

func Data

func Data(c *gin.Context, data interface{}, args ...string)

Data 通过指定的错误代码,输出错误信息

func Err

func Err(c *gin.Context, args ...interface{})

Err 输出错误信息 message, data

func ErrData

func ErrData(c *gin.Context, data interface{}, args ...string)

ErrData 输出错误信息

func Ok

func Ok(c *gin.Context, args ...interface{})

Ok 输出成功消息

Types

type RespData

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

RespData 响应结构体

type RespOK

type RespOK struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

RespOK 响应结构体

Jump to

Keyboard shortcuts

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