Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(m map[code.ResultCode]string)
Types ¶
type Base ¶
type Base struct { Code code.ResultCode `json:"code"` //业务状态码 Status bool `json:"status"` //状态【code==200】 Msg string `json:"msg"` //提示消息 一般为状态码对应信息 RequestID interface{} `json:"req_id,omitempty"` //请求ID Desc string `json:"desc,omitempty"` //Error信息 }
Base 统一返回对象
func NewResponse ¶
NewResponse 根据业务状态码和err信息创建新的结构返回
func NewSuccessResponse ¶
NewSuccessResponse success response
Click to show internal directories.
Click to hide internal directories.