response

package
v0.0.0-...-99b28bf Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FailedJsonExit

func FailedJsonExit(r *ghttp.Request, err error)

func Json

func Json(r *ghttp.Request, code int, message string, data interface{})

Json 标准返回结果数据结构封装。

func JsonExit

func JsonExit(r *ghttp.Request, err int, msg string, data ...interface{})

JsonExit 返回JSON数据并退出当前HTTP执行函数。

func SuccessJsonExit

func SuccessJsonExit(r *ghttp.Request, data ...interface{})

func XmlExit

func XmlExit(r *ghttp.Request, data interface{})

XmlExit 返回xml数据

Types

type JsonResponse

type JsonResponse struct {
	Code    int         `json:"code"`    // 错误码((0:成功, 1:失败, >1:错误码))
	Message string      `json:"message"` // 提示信息
	Data    interface{} `json:"data"`    // 返回数据(业务接口定义具体数据结构)
}

JsonResponse 数据返回通用JSON数据结构

Jump to

Keyboard shortcuts

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