2023-09-04 11:13:21 +02:00
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
type User struct {
|
2023-10-13 11:48:14 +02:00
|
|
|
BaseModel
|
2023-11-13 18:03:16 +01:00
|
|
|
Username string `json:"username"`
|
2023-11-15 16:16:44 +01:00
|
|
|
Password string `json:"-"`
|
2023-11-13 18:03:16 +01:00
|
|
|
Email string `json:"email"`
|
|
|
|
|
Avatar string `json:"avatar"`
|
|
|
|
|
IsActive bool `json:"isActive" gorm:"default:false"`
|
|
|
|
|
// CompanyID uint `json:"companyId"`
|
|
|
|
|
// Company Company
|
|
|
|
|
Companies []Company `gorm:"many2many:user_companies;"`
|
|
|
|
|
LoginAttempts int `gorm:"default:0"`
|
2023-09-04 11:13:21 +02:00
|
|
|
}
|
|
|
|
|
|
2023-11-15 16:16:44 +01:00
|
|
|
type LoginRequest struct {
|
|
|
|
|
Email string `json:"email"`
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
}
|
|
|
|
|
|
2023-10-30 19:21:43 +01:00
|
|
|
type ResetPasswordRequest struct {
|
|
|
|
|
Email string `json:"email"`
|
|
|
|
|
}
|
|
|
|
|
type UpdatePasswordRequest struct {
|
|
|
|
|
Password string `json:"password"`
|
|
|
|
|
Token string `json:"token"`
|
|
|
|
|
}
|
|
|
|
|
|
2023-09-18 12:27:40 +02:00
|
|
|
func (User) Update() (bool, error) {
|
2023-09-04 11:13:21 +02:00
|
|
|
return false, nil
|
|
|
|
|
}
|
2023-09-18 12:27:40 +02:00
|
|
|
func (User) Create() (bool, error) {
|
2023-09-04 11:13:21 +02:00
|
|
|
return false, nil
|
|
|
|
|
}
|
2023-09-18 12:27:40 +02:00
|
|
|
func (User) Delete() (bool, error) {
|
2023-09-04 11:13:21 +02:00
|
|
|
return false, nil
|
|
|
|
|
}
|