-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
60 lines (50 loc) · 1.29 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package webserver
import (
"time"
"github.com/janicduplessis/resultscrawler/pkg/api"
)
type (
jsonTime time.Time
// requests
loginRequest struct {
Email string `json:"email"`
Password string `json:"password"`
DeviceType int `json:"deviceType"`
}
registerRequest struct {
Email string `json:"email"`
Password string `json:"password"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
NotificationToken string `json:"notificationToken"`
DeviceType int `json:"deviceType"`
}
// responses
loginResponse struct {
Status int `json:"status"`
Token string `json:"token"`
User *userModel `json:"user"`
}
registerResponse struct {
Status int `json:"status"`
Token string `json:"token"`
User *userModel `json:"user"`
}
resultsResponse struct {
Year string `json:"year"`
Classes []api.Class `json:"classes"`
LastUpdate time.Time `json:"lastUpdate"`
}
// models
userModel struct {
Email string `json:"email"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
}
crawlerConfigClassModel struct {
ID string `json:"id"`
Name string `json:"name"`
Year string `json:"year"`
Group string `json:"group"`
}
)