2022-08-16 23:30:23 +08:00
|
|
|
package constant
|
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
CodeSuccess = 200
|
|
|
|
CodeErrBadRequest = 400
|
|
|
|
CodeErrUnauthorized = 401
|
2022-09-15 17:15:03 +08:00
|
|
|
CodeErrUnSafety = 402
|
2022-08-16 23:30:23 +08:00
|
|
|
CodeErrForbidden = 403
|
|
|
|
CodeErrNotFound = 404
|
2022-09-29 16:15:59 +08:00
|
|
|
CodePasswordExpired = 405
|
2022-12-05 11:12:07 +08:00
|
|
|
CodeAuth = 406
|
2022-08-16 23:30:23 +08:00
|
|
|
CodeErrInternalServer = 500
|
|
|
|
CodeErrHeader = 406
|
|
|
|
)
|
|
|
|
|
|
|
|
// internal
|
|
|
|
var (
|
|
|
|
ErrCaptchaCode = errors.New("ErrCaptchaCode")
|
2022-12-02 18:52:43 +08:00
|
|
|
ErrAuth = errors.New("ErrAuth")
|
2022-08-16 23:30:23 +08:00
|
|
|
ErrRecordExist = errors.New("ErrRecordExist")
|
|
|
|
ErrRecordNotFound = errors.New("ErrRecordNotFound")
|
|
|
|
ErrStructTransform = errors.New("ErrStructTransform")
|
2022-09-08 18:47:15 +08:00
|
|
|
ErrInitialPassword = errors.New("ErrInitialPassword")
|
2022-09-16 18:53:45 +08:00
|
|
|
ErrNotSupportType = errors.New("ErrNotSupportType")
|
|
|
|
ErrInvalidParams = errors.New("ErrInvalidParams")
|
2022-08-16 23:30:23 +08:00
|
|
|
|
|
|
|
ErrTokenParse = errors.New("ErrTokenParse")
|
|
|
|
|
|
|
|
ErrPageGenerate = errors.New("generate page info failed")
|
|
|
|
)
|
|
|
|
|
|
|
|
// api
|
|
|
|
var (
|
2022-09-29 16:15:59 +08:00
|
|
|
ErrTypeInternalServer = "ErrInternalServer"
|
|
|
|
ErrTypeInvalidParams = "ErrInvalidParams"
|
|
|
|
ErrTypeToken = "ErrToken"
|
|
|
|
ErrTypeTokenTimeOut = "ErrTokenTimeOut"
|
|
|
|
ErrTypeNotLogin = "ErrNotLogin"
|
|
|
|
ErrTypePasswordExpired = "ErrPasswordExpired"
|
|
|
|
ErrTypeNotSafety = "ErrNotSafety"
|
2022-12-02 10:31:07 +08:00
|
|
|
ErrNameIsExist = "ErrNameIsExist"
|
2022-08-16 23:30:23 +08:00
|
|
|
)
|
2022-12-01 15:48:40 +08:00
|
|
|
|
|
|
|
// app
|
|
|
|
var (
|
2022-12-02 18:17:16 +08:00
|
|
|
ErrPortInUsed = "ErrPortInUsed"
|
|
|
|
ErrAppLimit = "ErrAppLimit"
|
|
|
|
ErrAppRequired = "ErrAppRequired"
|
|
|
|
ErrFileCanNotRead = "ErrFileCanNotRead"
|
|
|
|
ErrFileToLarge = "ErrFileToLarge"
|
2022-12-04 17:45:54 +08:00
|
|
|
ErrNotInstall = "ErrNotInstall"
|
2022-12-01 15:48:40 +08:00
|
|
|
)
|
2022-12-04 16:10:48 +08:00
|
|
|
|
|
|
|
//website
|
|
|
|
var (
|
|
|
|
ErrDomainIsExist = "ErrDomainIsExist"
|
|
|
|
ErrAliasIsExist = "ErrAliasIsExist"
|
|
|
|
)
|