@@ -7,82 +7,82 @@ func NewAPIExceptionFromError(err error) *APIException {
77
88// NewUnauthorized 未认证
99func NewUnauthorized (format string , a ... interface {}) * APIException {
10- return NewAPIException ("" , Unauthorized , codeReason (Unauthorized ), format , a ... )
10+ return NewAPIException (Unauthorized , codeReason (Unauthorized ), format , a ... )
1111}
1212
1313// NewPermissionDeny 没有权限访问
1414func NewPermissionDeny (format string , a ... interface {}) * APIException {
15- return NewAPIException ("" , Forbidden , codeReason (Forbidden ), format , a ... )
15+ return NewAPIException (Forbidden , codeReason (Forbidden ), format , a ... )
1616}
1717
1818// NewAccessTokenIllegal 访问token过期
1919func NewAccessTokenIllegal (format string , a ... interface {}) * APIException {
20- return NewAPIException ("" , AccessTokenIllegal , codeReason (AccessTokenIllegal ), format , a ... )
20+ return NewAPIException (AccessTokenIllegal , codeReason (AccessTokenIllegal ), format , a ... )
2121}
2222
2323// NewRefreshTokenIllegal 访问token过期
2424func NewRefreshTokenIllegal (format string , a ... interface {}) * APIException {
25- return NewAPIException ("" , RefreshTokenIllegal , codeReason (RefreshTokenIllegal ), format , a ... )
25+ return NewAPIException (RefreshTokenIllegal , codeReason (RefreshTokenIllegal ), format , a ... )
2626}
2727
2828// NewOtherClientsLoggedIn 其他端登录
2929func NewOtherClientsLoggedIn (format string , a ... interface {}) * APIException {
30- return NewAPIException ("" , OtherClientsLoggedIn , codeReason (OtherClientsLoggedIn ), format , a ... )
30+ return NewAPIException (OtherClientsLoggedIn , codeReason (OtherClientsLoggedIn ), format , a ... )
3131}
3232
3333// NewOtherPlaceLoggedIn 异地登录
3434func NewOtherPlaceLoggedIn (format string , a ... interface {}) * APIException {
35- return NewAPIException ("" , OtherPlaceLoggedIn , codeReason (OtherPlaceLoggedIn ), format , a ... )
35+ return NewAPIException (OtherPlaceLoggedIn , codeReason (OtherPlaceLoggedIn ), format , a ... )
3636}
3737
3838// NewOtherIPLoggedIn 异常IP登录
3939func NewOtherIPLoggedIn (format string , a ... interface {}) * APIException {
40- return NewAPIException ("" , OtherIPLoggedIn , codeReason (OtherIPLoggedIn ), format , a ... )
40+ return NewAPIException (OtherIPLoggedIn , codeReason (OtherIPLoggedIn ), format , a ... )
4141}
4242
4343// NewSessionTerminated 会话结束
4444func NewSessionTerminated (format string , a ... interface {}) * APIException {
45- return NewAPIException ("" , SessionTerminated , codeReason (SessionTerminated ), format , a ... )
45+ return NewAPIException (SessionTerminated , codeReason (SessionTerminated ), format , a ... )
4646}
4747
4848// NewAccessTokenExpired 访问token过期
4949func NewAccessTokenExpired (format string , a ... interface {}) * APIException {
50- return NewAPIException ("" , AccessTokenExpired , codeReason (SessionTerminated ), format , a ... )
50+ return NewAPIException (AccessTokenExpired , codeReason (SessionTerminated ), format , a ... )
5151}
5252
5353// NewRefreshTokenExpired 刷新token过期
5454func NewRefreshTokenExpired (format string , a ... interface {}) * APIException {
55- return NewAPIException ("" , RefreshTokenExpired , codeReason (RefreshTokenExpired ), format , a ... )
55+ return NewAPIException (RefreshTokenExpired , codeReason (RefreshTokenExpired ), format , a ... )
5656}
5757
5858// NewBadRequest todo
5959func NewBadRequest (format string , a ... interface {}) * APIException {
60- return NewAPIException ("" , BadRequest , codeReason (BadRequest ), format , a ... )
60+ return NewAPIException (BadRequest , codeReason (BadRequest ), format , a ... )
6161}
6262
6363// NewNotFound todo
6464func NewNotFound (format string , a ... interface {}) * APIException {
65- return NewAPIException ("" , NotFound , codeReason (NotFound ), format , a ... )
65+ return NewAPIException (NotFound , codeReason (NotFound ), format , a ... )
6666}
6767
6868// NewConflict todo
6969func NewConflict (format string , a ... interface {}) * APIException {
70- return NewAPIException ("" , Conflict , codeReason (Conflict ), format , a ... )
70+ return NewAPIException (Conflict , codeReason (Conflict ), format , a ... )
7171}
7272
7373// NewInternalServerError 500
7474func NewInternalServerError (format string , a ... interface {}) * APIException {
75- return NewAPIException ("" , InternalServerError , codeReason (InternalServerError ), format , a ... )
75+ return NewAPIException (InternalServerError , codeReason (InternalServerError ), format , a ... )
7676}
7777
7878// NewVerifyCodeRequiredError 50018
7979func NewVerifyCodeRequiredError (format string , a ... interface {}) * APIException {
80- return NewAPIException ("" , VerifyCodeRequired , codeReason (VerifyCodeRequired ), format , a ... )
80+ return NewAPIException (VerifyCodeRequired , codeReason (VerifyCodeRequired ), format , a ... )
8181}
8282
8383// NewPasswordExired 50019
8484func NewPasswordExired (format string , a ... interface {}) * APIException {
85- return NewAPIException ("" , PasswordExired , codeReason (PasswordExired ), format , a ... )
85+ return NewAPIException (PasswordExired , codeReason (PasswordExired ), format , a ... )
8686}
8787
8888// IsNotFoundError 判断是否是NotFoundError
0 commit comments