codeword/internal/models/user.go
2023-12-31 15:22:03 +03:00

36 lines
1.1 KiB
Go

package models
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
type User struct {
ID primitive.ObjectID `bson:"_id,omitempty"`
Login string `bson:"login,omitempty"`
Email string `bson:"email,omitempty"`
Password string `bson:"password,omitempty"`
PhoneNumber string `bson:"phoneNumber,omitempty"`
IsDeleted bool `bson:"isDeleted,omitempty"`
CreatedAt time.Time `bson:"createdAt,omitempty"`
UpdatedAt time.Time `bson:"updatedAt,omitempty"`
DeletedAt *time.Time `bson:"deletedAt,omitempty"`
}
type RestoreRequest struct {
ID string // xid или ObjectID
CreatedAt time.Time
Sign string // подпись
Email string // email из запроса
UserID string // айдишник юзера, которого нашли по email
Sent bool
SentAt time.Time
}
type RecoveryRecord struct {
UserID string `bson:"user_id"`
Email string `bson:"email"`
Key string `bson:"key"`
CreatedAt time.Time `bson:"created_at"`
}