modified: README.md

modified:   serv_nginx/api_bb/internal/config/config.go
	new file:   serv_nginx/api_bb/internal/models/email.go
add email config to config api_bb and email model into models
This commit is contained in:
2025-10-22 01:30:16 +05:00
parent e793552f99
commit 64301b9135
3 changed files with 44 additions and 1 deletions
@@ -0,0 +1,33 @@
// models/email.go
package models
import (
"time"
"gorm.io/gorm"
)
type EmailVerification struct {
ID uint `json:"id" gorm:"primaryKey"`
UserID uint `json:"user_id" gorm:"not null;index"`
Token string `json:"token" gorm:"size:100;not null;uniqueIndex"`
Email string `json:"email" gorm:"not null"`
Type string `json:"type" gorm:"size:20;not null"` // verification, password_reset
ExpiresAt time.Time `json:"expires_at" gorm:"not null"`
Used bool `json:"used" gorm:"default:false"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"-" gorm:"index"`
// Связи
User User `gorm:"foreignKey:UserID" json:"user,omitempty"`
}
type PasswordResetRequest struct {
Email string `json:"email" validate:"required,email"`
}
type PasswordResetConfirm struct {
Token string `json:"token" validate:"required"`
Password string `json:"password" validate:"required,min=6"`
}