codeword/internal/models/user.go

36 lines
1.1 KiB
Go
Raw Normal View History

2023-12-29 11:30:20 +00:00
package models
2023-12-31 12:22:03 +00:00
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"time"
)
2023-12-29 11:30:20 +00:00
type User struct {
2023-12-31 12:22:03 +00:00
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"`
2023-12-29 11:30:20 +00:00
}
type RestoreRequest struct {
ID string // xid или ObjectID
CreatedAt time.Time
Sign string // подпись
Email string // email из запроса
UserID string // айдишник юзера, которого нашли по email
Sent bool
SentAt time.Time
}
2023-12-31 12:22:03 +00:00
type RecoveryRecord struct {
UserID string `bson:"user_id"`
Email string `bson:"email"`
2024-01-03 13:50:11 +00:00
Key []byte `bson:"key"`
2023-12-31 12:22:03 +00:00
CreatedAt time.Time `bson:"created_at"`
}