21 lines
478 B
Go
21 lines
478 B
Go
package model
|
|
|
|
import (
|
|
"SciencesServer/app/common/model"
|
|
"SciencesServer/utils"
|
|
)
|
|
|
|
type UserInstance struct{ *model.UserInstance }
|
|
|
|
func (m *UserInstance) UUIDToString() string {
|
|
return utils.UintToString(m.UUID)
|
|
}
|
|
|
|
func (m *UserInstance) ValidatePassword(password string) bool {
|
|
return utils.HashCompare([]byte(m.Password), []byte(utils.Md5String(password, m.Salt)))
|
|
}
|
|
|
|
func NewUserInstance() *UserInstance {
|
|
return &UserInstance{UserInstance: model.NewUserInstance()}
|
|
}
|