e

package
v0.0.0-...-8bc0546 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2023 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MsgFlags = [...]string{
	SUCCESS:       "ok",
	ERROR:         "fail",
	InvalidParams: "请求参数错误",

	ErrorCaptcha:           "验证码错误",
	ErrorDatabase:          "数据库错误",
	ErrorExistUser:         "用户名已存在",
	ErrorFailEncryption:    "密码加密失败",
	ErrorExistUserNotFound: "用户不存在",
	ErrorNotCompare:        "密码不匹配",
	ErrorUnmarshalType:     "JSON类型不匹配",

	ErrorAuthToken:             "token认证失败",
	ErrorAuthCheckTokenTimeout: "token过期",
	ErrorUploadFail:            "图片上传失败",
	ErrorSendEmail:             "邮件发送失败",
	ErrorProductUpload:         "产品图片上传错误",
}

Functions

func GetMsg

func GetMsg(code CustomError) string

GetMsg 获取状态码对应信息

Types

type CustomError

type CustomError int
const (
	SUCCESS       CustomError = 200
	ERROR         CustomError = 500
	InvalidParams CustomError = 400

	// User Error
	ErrorExistUser CustomError = 30001 + iota
	ErrorCaptcha
	ErrorDatabase
	ErrorFailEncryption
	ErrorExistUserNotFound
	ErrorNotCompare
	ErrorUnmarshalType

	ErrorAuthToken
	ErrorAuthCheckTokenTimeout
	ErrorUploadFail
	ErrorSendEmail

	// Product Error
	ErrorProductUpload CustomError = 40001 + iota
)

Jump to

Keyboard shortcuts

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