Documentation
¶
Index ¶
- Constants
- Variables
- type Resp
- func Data(data interface{}) *Resp
- func Error(err error) *Resp
- func ErrorBadRequest() *Resp
- func ErrorBadRequestWithMsg(msg string) *Resp
- func ErrorNotFound() *Resp
- func ErrorUnauthorized() *Resp
- func FacadeError(msg string) *Resp
- func Fail() *Resp
- func OK() *Resp
- func Status(ok bool) *Resp
- func SysError(msg string) *Resp
- func UserError(msg string) *Resp
Constants ¶
View Source
const (
// CodeFacadeErr 通用系统内部错误
CodeFacadeErr = 30000
)
View Source
const (
CodeOK = 0
)
View Source
const (
// CodeSystemErr 通用系统内部错误
CodeSystemErr = 10000
)
Variables ¶
View Source
var ( // CodeUserErr 通用用户错误 CodeUserErr = 20000 CodeErrBadRequest = 20400 CodeErrNotFound = 20404 )
Functions ¶
This section is empty.
Types ¶
type Resp ¶
Resp Code 定义:错误产生来源+四位数字编号(业务定义),返回0表示成功 Code 1: 用户错误,2: 系统错误,3: 调用第三方系统错误
func ErrorBadRequest ¶
func ErrorBadRequest() *Resp
func ErrorBadRequestWithMsg ¶
func ErrorNotFound ¶
func ErrorNotFound() *Resp
func ErrorUnauthorized ¶
func ErrorUnauthorized() *Resp
func FacadeError ¶
Click to show internal directories.
Click to hide internal directories.