common

package
v0.0.0-...-9a786c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternal    = NewRespError(10000, "系统异常")
	ErrBusyRequest = NewRespError(10001, "请求频繁")
	ErrParameter   = NewRespError(10002, "请求参数异常")
	ErrWrongCode   = NewRespError(10003, "验证码错误")

	ErrQueryUser   = NewRespError(20001, "查询用户信息失败")
	ErrWrongPasswd = NewRespError(20002, "用户名或密码错误")
	ErrAddUser     = NewRespError(20003, "新增用户失败")
	ErrUserPhone   = NewRespError(20004, "手机号校验错误")
)

Functions

func NewRespError

func NewRespError(status int, msg string, data ...interface{}) error

Types

type BasicResponse

type BasicResponse struct {
	Status int         `json:"status"`
	Data   interface{} `json:"data"`
	Msg    string      `json:"msg"`
}

func (BasicResponse) Error

func (r BasicResponse) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL