forked from free-lancers/electricity_bill_calc_service
feat(login):基本完成用户登录,待测。
This commit is contained in:
21
exceptions/auth.go
Normal file
21
exceptions/auth.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package exceptions
|
||||
|
||||
import "fmt"
|
||||
|
||||
type AuthenticationError struct {
|
||||
Code int16
|
||||
Message string
|
||||
NeedReset bool
|
||||
}
|
||||
|
||||
func NewAuthenticationError(code int16, msg string) *AuthenticationError {
|
||||
return &AuthenticationError{
|
||||
Code: code,
|
||||
Message: msg,
|
||||
NeedReset: false,
|
||||
}
|
||||
}
|
||||
|
||||
func (e AuthenticationError) Error() string {
|
||||
return fmt.Sprintf("[%d]%s", e.Code, e.Message)
|
||||
}
|
Reference in New Issue
Block a user