Documentation ¶
Index ¶
- func ErrorResult(r *ghttp.Request, code ErrorCode, message string)
- func Json(r *ghttp.Request, code ErrorCode, message string, data ...interface{})
- func JsonERR(r *ghttp.Request, msg string, data ...interface{})
- func JsonExit(r *ghttp.Request, err ErrorCode, msg string, data ...interface{})
- func JsonOK(r *ghttp.Request, data ...interface{})
- func SuccessResult(r *ghttp.Request, data interface{})
- type ErrorCode
- type JsonResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SuccessResult ¶
Types ¶
type JsonResponse ¶
type JsonResponse struct { Code ErrorCode `json:"code"` // 错误码((0:成功, 1:失败, >1:错误码)) Message string `json:"message"` // 提示信息 Data interface{} `json:"data"` // 返回数据(业务接口定义具体数据结构) }
数据返回通用JSON数据结构
Click to show internal directories.
Click to hide internal directories.