Files

23 lines
462 B
Go
Raw Normal View History

2021-09-28 18:23:34 +08:00
package model
2021-09-29 16:25:56 +08:00
import (
"SciencesServer/app/common/model"
"SciencesServer/utils"
)
2021-09-28 18:23:34 +08:00
type TenantUser struct {
*model.TenantUser
}
func (m *TenantUser) UUIDToString() string {
2021-09-29 16:25:56 +08:00
return utils.UintToString(m.UUID)
2021-09-28 18:23:34 +08:00
}
func (m *TenantUser) ValidatePassword(password string) bool {
2021-09-29 16:25:56 +08:00
return utils.HashCompare([]byte(m.Password), []byte(utils.Md5String(password, m.Salt)))
2021-09-28 18:23:34 +08:00
}
func NewTenantUser() *TenantUser {
return &TenantUser{TenantUser: model.NewTenantUser()}
}