response

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Json

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

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

func JsonExit

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

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

Types

type JsonResponse

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

数据返回通用JSON数据结构

Jump to

Keyboard shortcuts

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