Documentation ¶
Index ¶
- func Custum(c IRespWriter, data gin.H)
- func Error(c IRespWriter, code int, err error, msg string)
- func ErrorData(c IRespWriter, code int, err error, msg string, data interface{})
- func GenerateMsgIDFromContext(c IRespWriter) string
- func OK(c IRespWriter, data interface{}, msg string)
- func PageOK(c IRespWriter, result interface{}, count int, pageIndex int, pageSize int, ...)
- type DebugInfo
- type IRespWriter
- type PageData
- type Response
- func (r *Response) SetCode(code int) Responses
- func (r *Response) SetData(data interface{}) Responses
- func (r *Response) SetError(err error) Responses
- func (r *Response) SetMsg(msg string) Responses
- func (r *Response) SetSuccess(success bool) Responses
- func (r *Response) SetTraceID(requestId string) Responses
- type Responses
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorData ¶
func ErrorData(c IRespWriter, code int, err error, msg string, data interface{})
Error 失败数据处理
func GenerateMsgIDFromContext ¶
func GenerateMsgIDFromContext(c IRespWriter) string
GenerateMsgIDFromContext 生成msgID
Types ¶
type IRespWriter ¶
type Response ¶
type Response struct { RequestId string `json:"requestId,omitempty"` // 链路id Code int `json:"code,omitempty"` // 状态码 Msg string `json:"msg,omitempty"` // 提示消息(可展示) Status string `json:"status,omitempty"` Data interface{} `json:"data,omitempty"` // 数据内容 Debug *DebugInfo `json:"debug,omitempty"` // 调试模式下异常信息 }
func (*Response) SetSuccess ¶
func (*Response) SetTraceID ¶
Click to show internal directories.
Click to hide internal directories.