27 lines
518 B
Go
27 lines
518 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type User struct {
|
|
Id string `gorm:"type(uuid);unique"`
|
|
Email string `gorm:"unique"`
|
|
FirstName string
|
|
LastName string
|
|
Password string
|
|
IsActive bool
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
func (u *User) TableName() string {
|
|
return "users"
|
|
}
|
|
|
|
// func (u *User) SetPassword(password string) (string, error) {
|
|
// secretKey := Config.Application.SecretKey
|
|
// bytes, err := bcrypt.GenerateFromPassword([]byte(password), 14)
|
|
// return string(bytes), err
|
|
// }
|