result

package
v0.0.0-...-7e3dfe9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

View Source
const (

	// FAIL 失败默认code返回1
	FAIL = "1"

	// SUCCESS 成功默认code返回0
	SUCCESS = "0"
)

Variables

This section is empty.

Functions

func Fail

func Fail(c *gin.Context)

Fail 失败

func FailDataMsg

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

FailDataMsg 带数据和返回消息的失败

func FailMsg

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

FailMsg 带message消息的失败

func Ok

func Ok(c *gin.Context)

Ok 成功

func OkData

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

OkData 带数据的成功

func OkDataMsg

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

OkDataMsg 带数据和返回消息的成功

func OkMsg

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

OkMsg 带message消息的成功

func Result

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

Result gin 统一返回

Types

type Response

type Response struct {

	/** 状态码 */
	Code string `json:"code"`

	/** 内容体 */
	Content interface{} `json:"content"`

	/** 消息 */
	Message string `json:"message"`
}

Response 统一 json 结构体

Jump to

Keyboard shortcuts

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