Added reset password route

This commit is contained in:
Nedim
2023-10-30 19:21:43 +01:00
parent 75692d7b20
commit 72ccd5e71c
16 changed files with 531 additions and 33 deletions

View File

@@ -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"`

View File

@@ -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
View 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
}

View File

@@ -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
}