codes

package
v0.0.0-...-8200d01 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SUCCESS       = 200
	ERROR         = 500
	InvalidParams = 400

	ErrExistTag        = 10001
	ErrNotExistTag     = 10002
	ErrNotExistArticle = 10003

	ErrAuthCheckTokenFail    = 20001
	ErrAuthCheckTokenTimeout = 20002
	ErrAuthToken             = 20003
	ErrAuth                  = 20004

	ErrExistUser = 30001

	PageNotFound = 40001
)

错误码定义

Variables

View Source
var MsgFlags = map[int]string{
	SUCCESS:                  "ok",
	ERROR:                    "fail",
	InvalidParams:            "请求参数错误",
	ErrExistTag:              "已存在该标签名称",
	ErrNotExistTag:           "该标签不存在",
	ErrNotExistArticle:       "该文章不存在",
	ErrAuthCheckTokenFail:    "Token鉴权失败",
	ErrAuthCheckTokenTimeout: "Token已超时",
	ErrAuthToken:             "Token生成失败",
	ErrAuth:                  "Token错误",
	PageNotFound:             "Page not found",
	ErrExistUser:             "用户名已存在",
}

MsgFlags 错误信息

Functions

func GetMsg

func GetMsg(code int) string

GetMsg 获取错误信息

Types

This section is empty.

Jump to

Keyboard shortcuts

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