Documentation ¶
Index ¶
- Constants
- func FailJson(isExit bool, r *ghttp.Request, msg string, data ...interface{})
- func JsonExit(r *ghttp.Request, code int, msg string, data ...interface{})
- func RJson(r *ghttp.Request, code int, msg string, data ...interface{})
- func SusJson(isExit bool, r *ghttp.Request, msg string, data ...interface{})
- func WriteTpl(r *ghttp.Request, tpl string, view *gview.View, params ...gview.Params) error
- type Response
- func (res *Response) FailJson(isExit bool, r *ghttp.Request, msg string, data ...interface{})
- func (res *Response) JsonExit(r *ghttp.Request, code int, msg string, data ...interface{})
- func (res *Response) RJson(r *ghttp.Request, code int, msg string, data ...interface{})
- func (res *Response) Redirect(r *ghttp.Request, location string, code ...int)
- func (res *Response) SusJson(isExit bool, r *ghttp.Request, msg string, data ...interface{})
- func (res *Response) WriteTpl(r *ghttp.Request, tpl string, view *gview.View, params ...gview.Params) error
Constants ¶
View Source
const ( SuccessCode int = 0 ErrorCode int = -1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Response ¶
type Response struct { // 代码 Code int `json:"code" example:"200"` // 数据集 Data interface{} `json:"data"` // 消息 Msg string `json:"message"` }
func (*Response) RJson ¶
标准返回结果数据结构封装。 返回固定数据结构的JSON: code: 状态码(200:成功,302跳转,和http请求状态码一至); msg: 请求结果信息; data: 请求结果,根据不同接口返回结果的数据结构不同;
Click to show internal directories.
Click to hide internal directories.