Added reset password route
This commit is contained in:
@@ -22,6 +22,20 @@ type Company struct {
|
||||
Devices []Device `json:"devices"`
|
||||
}
|
||||
|
||||
type School struct {
|
||||
BaseModel
|
||||
Name string `json:"name"`
|
||||
Address string `json:"address"`
|
||||
Students []Student `json:"students" gorm:"foreignKey:SchoolID"`
|
||||
}
|
||||
|
||||
type Student struct {
|
||||
BaseModel
|
||||
Name string `json:"name"`
|
||||
Age int `json:"age"`
|
||||
SchoolID uint `json:"schoolId" gorm:"index"`
|
||||
}
|
||||
|
||||
type CompanyShortResponse struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
|
||||
@@ -8,12 +8,17 @@ import (
|
||||
|
||||
type Notification struct {
|
||||
gorm.Model
|
||||
Title string
|
||||
Title string
|
||||
NotificationType string
|
||||
Text string
|
||||
CompanyID int
|
||||
Text string
|
||||
CompanyID int
|
||||
}
|
||||
|
||||
type EmailNotification struct {
|
||||
Subject string
|
||||
Email string
|
||||
Body string
|
||||
}
|
||||
|
||||
type GetNotificationsResponse struct {
|
||||
Type string `json:"type"`
|
||||
|
||||
18
models/password_tokens.go
Normal file
18
models/password_tokens.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package models
|
||||
|
||||
type PasswordTokens struct {
|
||||
BaseModel
|
||||
UserID uint `json:"username"`
|
||||
Token string `json:"token"`
|
||||
ExpiryDate string `json:"expiryDate"`
|
||||
}
|
||||
|
||||
func (PasswordTokens) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (PasswordTokens) Create() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
func (PasswordTokens) Delete() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
@@ -6,9 +6,18 @@ type User struct {
|
||||
Password string `json:"password"`
|
||||
Email string `json:"email"`
|
||||
Avatar string `json:"avatar"`
|
||||
IsActive bool `json:"isActive" gorm:"default:false"`
|
||||
CompanyID uint `json:"companyId"`
|
||||
}
|
||||
|
||||
type ResetPasswordRequest struct {
|
||||
Email string `json:"email"`
|
||||
}
|
||||
type UpdatePasswordRequest struct {
|
||||
Password string `json:"password"`
|
||||
Token string `json:"token"`
|
||||
}
|
||||
|
||||
func (User) Update() (bool, error) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user