-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
74 lines (60 loc) · 1.11 KB
/
model.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package internal
import (
"time"
)
type Course struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
UserID uint
Name string
Description string
Image string
Task []Task
Language string
DifficultyLevel string
Rate float32
RateCounter int
Type string
MaxPoints int
}
const (
NormalType string = "normal"
PuzzleType string = "puzzle"
)
type CourseResult struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
UserID uint
CourseID uint
Points uint
Phase string
Passed bool
}
const (
StartedPhase string = "started"
FinishedPhase string = "finished"
)
type Task struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
CourseID uint
Word string
Translate string
Image string
}
type User struct {
ID uint `gorm:"primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
Email string
FirstName string
LastName string
Password string
Avatar string
Level int
NextLevel string
Points int
}