-
Notifications
You must be signed in to change notification settings - Fork 1
/
models.go
36 lines (29 loc) · 1.03 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package gah
import (
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type LoginStruct struct {
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required,min=3"`
}
type RegisterStruct struct {
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required,min=3"`
}
type UserStruct struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id"`
Email string `json:"email" bson:"email"`
Password string `json:"password" bson:"password"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
}
type TokenStruct struct {
Token string `json:"token" bson:"token"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
}
type UserRegisterStruct struct {
Email string `json:"email" bson:"email"`
Password string `json:"password" bson:"password"`
CreatedAt time.Time `json:"createdAt" bson:"createdAt"`
Tokens []TokenStruct `json: "tokens" bson:"tokens"`
}