@@ -7,82 +7,82 @@ func NewAPIExceptionFromError(err error) *APIException {
7
7
8
8
// NewUnauthorized 未认证
9
9
func NewUnauthorized (format string , a ... interface {}) * APIException {
10
- return NewAPIException ("" , Unauthorized , codeReason (Unauthorized ), format , a ... )
10
+ return NewAPIException (Unauthorized , codeReason (Unauthorized ), format , a ... )
11
11
}
12
12
13
13
// NewPermissionDeny 没有权限访问
14
14
func NewPermissionDeny (format string , a ... interface {}) * APIException {
15
- return NewAPIException ("" , Forbidden , codeReason (Forbidden ), format , a ... )
15
+ return NewAPIException (Forbidden , codeReason (Forbidden ), format , a ... )
16
16
}
17
17
18
18
// NewAccessTokenIllegal 访问token过期
19
19
func NewAccessTokenIllegal (format string , a ... interface {}) * APIException {
20
- return NewAPIException ("" , AccessTokenIllegal , codeReason (AccessTokenIllegal ), format , a ... )
20
+ return NewAPIException (AccessTokenIllegal , codeReason (AccessTokenIllegal ), format , a ... )
21
21
}
22
22
23
23
// NewRefreshTokenIllegal 访问token过期
24
24
func NewRefreshTokenIllegal (format string , a ... interface {}) * APIException {
25
- return NewAPIException ("" , RefreshTokenIllegal , codeReason (RefreshTokenIllegal ), format , a ... )
25
+ return NewAPIException (RefreshTokenIllegal , codeReason (RefreshTokenIllegal ), format , a ... )
26
26
}
27
27
28
28
// NewOtherClientsLoggedIn 其他端登录
29
29
func NewOtherClientsLoggedIn (format string , a ... interface {}) * APIException {
30
- return NewAPIException ("" , OtherClientsLoggedIn , codeReason (OtherClientsLoggedIn ), format , a ... )
30
+ return NewAPIException (OtherClientsLoggedIn , codeReason (OtherClientsLoggedIn ), format , a ... )
31
31
}
32
32
33
33
// NewOtherPlaceLoggedIn 异地登录
34
34
func NewOtherPlaceLoggedIn (format string , a ... interface {}) * APIException {
35
- return NewAPIException ("" , OtherPlaceLoggedIn , codeReason (OtherPlaceLoggedIn ), format , a ... )
35
+ return NewAPIException (OtherPlaceLoggedIn , codeReason (OtherPlaceLoggedIn ), format , a ... )
36
36
}
37
37
38
38
// NewOtherIPLoggedIn 异常IP登录
39
39
func NewOtherIPLoggedIn (format string , a ... interface {}) * APIException {
40
- return NewAPIException ("" , OtherIPLoggedIn , codeReason (OtherIPLoggedIn ), format , a ... )
40
+ return NewAPIException (OtherIPLoggedIn , codeReason (OtherIPLoggedIn ), format , a ... )
41
41
}
42
42
43
43
// NewSessionTerminated 会话结束
44
44
func NewSessionTerminated (format string , a ... interface {}) * APIException {
45
- return NewAPIException ("" , SessionTerminated , codeReason (SessionTerminated ), format , a ... )
45
+ return NewAPIException (SessionTerminated , codeReason (SessionTerminated ), format , a ... )
46
46
}
47
47
48
48
// NewAccessTokenExpired 访问token过期
49
49
func NewAccessTokenExpired (format string , a ... interface {}) * APIException {
50
- return NewAPIException ("" , AccessTokenExpired , codeReason (SessionTerminated ), format , a ... )
50
+ return NewAPIException (AccessTokenExpired , codeReason (SessionTerminated ), format , a ... )
51
51
}
52
52
53
53
// NewRefreshTokenExpired 刷新token过期
54
54
func NewRefreshTokenExpired (format string , a ... interface {}) * APIException {
55
- return NewAPIException ("" , RefreshTokenExpired , codeReason (RefreshTokenExpired ), format , a ... )
55
+ return NewAPIException (RefreshTokenExpired , codeReason (RefreshTokenExpired ), format , a ... )
56
56
}
57
57
58
58
// NewBadRequest todo
59
59
func NewBadRequest (format string , a ... interface {}) * APIException {
60
- return NewAPIException ("" , BadRequest , codeReason (BadRequest ), format , a ... )
60
+ return NewAPIException (BadRequest , codeReason (BadRequest ), format , a ... )
61
61
}
62
62
63
63
// NewNotFound todo
64
64
func NewNotFound (format string , a ... interface {}) * APIException {
65
- return NewAPIException ("" , NotFound , codeReason (NotFound ), format , a ... )
65
+ return NewAPIException (NotFound , codeReason (NotFound ), format , a ... )
66
66
}
67
67
68
68
// NewConflict todo
69
69
func NewConflict (format string , a ... interface {}) * APIException {
70
- return NewAPIException ("" , Conflict , codeReason (Conflict ), format , a ... )
70
+ return NewAPIException (Conflict , codeReason (Conflict ), format , a ... )
71
71
}
72
72
73
73
// NewInternalServerError 500
74
74
func NewInternalServerError (format string , a ... interface {}) * APIException {
75
- return NewAPIException ("" , InternalServerError , codeReason (InternalServerError ), format , a ... )
75
+ return NewAPIException (InternalServerError , codeReason (InternalServerError ), format , a ... )
76
76
}
77
77
78
78
// NewVerifyCodeRequiredError 50018
79
79
func NewVerifyCodeRequiredError (format string , a ... interface {}) * APIException {
80
- return NewAPIException ("" , VerifyCodeRequired , codeReason (VerifyCodeRequired ), format , a ... )
80
+ return NewAPIException (VerifyCodeRequired , codeReason (VerifyCodeRequired ), format , a ... )
81
81
}
82
82
83
83
// NewPasswordExired 50019
84
84
func NewPasswordExired (format string , a ... interface {}) * APIException {
85
- return NewAPIException ("" , PasswordExired , codeReason (PasswordExired ), format , a ... )
85
+ return NewAPIException (PasswordExired , codeReason (PasswordExired ), format , a ... )
86
86
}
87
87
88
88
// IsNotFoundError 判断是否是NotFoundError
0 commit comments