go-chat/user/user.go

18 lines
302 B
Go
Raw Normal View History

2021-04-22 06:12:35 +00:00
package user
import "errors"
type User struct {
2021-04-25 08:29:30 +00:00
Id int `json:"id"`
Name string `json:"name"`
Sex int8 `json:"sex"`
Password string `json:"password"`
2021-04-22 06:12:35 +00:00
}
func (u *User) CheckPassword(p string) error {
if p != u.Password {
return errors.New("password error")
}
return nil
}