-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.go
More file actions
60 lines (46 loc) · 931 Bytes
/
Copy pathmodel.go
File metadata and controls
60 lines (46 loc) · 931 Bytes
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 main
//data models used in the database and frontend
type User struct {
Name string
Handle string `gorm:"unique"`
Bio string
UUID string `gorm:"unique"`
Moderator bool
}
type Like struct {
PostUUID string
UserUUID string
}
type Comment struct {
Content string
UUID string
PostUUID string
UserUUID string
UserName string
}
type Post struct {
Title string
Description string
Weight int
Lift string
UUID string `gorm:"unique"`
Likes int
Comments int
UserUUID string
UserName string
Liked bool `gorm:"-"` //shitty hack for passing thru to postcard template
Owner bool `gorm:"-"` //same shit
}
type ApplicationState struct {
SignedIn bool
UUID string //uuid that is signed in right now
UserName string
Moderator bool //currently signed in user is moderator?
Cookie string
}
type Auth struct {
UserUUID string
Email string
Password string //TODO: change this
CurrentCookie string
}