Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ResponseCodeSuccess 默认请求成功返回,返回内容参照阿里Java研发规范 ResponseCodeSuccess = "00000" ResponseCodeSystemError = "B0001" )
View Source
const ( ResponseMessageSuccess = "success" ResponseMessageSystemError = "system error" )
Variables ¶
This section is empty.
Functions ¶
func GinWrapper ¶
func GinWrapper(handlerFunc func(ctx *GinCtx) (responseData interface{}, err error)) gin.HandlerFunc
GinWrapper 请求方法包装
Types ¶
type RequestData ¶
type RequestData interface{}
type Response ¶
type Response struct { Code string `json:"code"` // 自定义状态码 Message string `json:"message"` // 响应描述 Data ResponseData `json:"data"` // 响应数据 TraceId string `json:"trace_id"` // traceIdKey }
Response 通用响应体
func NewResponseError ¶
func NewResponseSuccess ¶
NewResponseSuccess 请求成功
func NewResponseSystemError ¶
Click to show internal directories.
Click to hide internal directories.