feat(login):基本完成用户登录,待测。

This commit is contained in:
徐涛
2022-08-12 06:32:25 +08:00
parent 8f4e0320fd
commit 1c5bcf033b
8 changed files with 265 additions and 0 deletions

21
exceptions/auth.go Normal file
View 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)
}