-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser.go
73 lines (67 loc) · 4.35 KB
/
user.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
package models
import "go.mongodb.org/mongo-driver/bson/primitive"
/*
User Data
- Contains user identifiable data
*/
type User struct {
ID primitive.ObjectID `json:"id,omitempty" bson:"_id"`
UUID string `json:"uuid,omitempty" bson:"uuid"`
UserName string `json:"username,omitempty" bson:"username"`
Bio string `json:"bio,omitempty" bson:"bio,omitempty"`
ImageURL string `json:"image_url,omitempty" bson:"image_url,omitempty"`
Clubs *[]primitive.ObjectID `json:"clubs,omitempty" bson:"clubs,omitempty"`
Organizations *[]primitive.ObjectID `json:"organizations,omitempty" bson:"organizations,omitempty"`
Sports []string `json:"sports,omitempty" bson:"sports,omitempty"`
Visibility string `json:"visibility,omitempty" bson:"visibility"`
AcceptedEULA *bool `json:"accepted_eula,omitempty" bson:"accepted_eula,omitempty"`
HasOnboarded *bool `json:"has_onboarded,omitempty" bson:"has_onboarded,omitempty"`
BlockedUsers *[]string `json:"blocked_users,omitempty" bson:"blocked_users,omitempty"`
Hometown *Location `json:"hometown,omitempty" bson:"hometown,omitempty"`
LastLocation *Location `json:"last_location,omitempty" bson:"last_location,omitempty"`
DeviceTokens *[]DeviceToken `json:"device_tokens,omitempty" bson:"device_tokens,omitempty"`
}
type UserDao struct {
UserName *string `json:"username,omitempty" bson:"username"`
Bio *string `json:"bio,omitempty" bson:"bio,omitempty"`
ImageURL *string `json:"image_url,omitempty" bson:"image_url,omitempty"`
Clubs *[]primitive.ObjectID `json:"clubs,omitempty" bson:"clubs,omitempty"`
Organizations *[]primitive.ObjectID `json:"organizations,omitempty" bson:"organizations,omitempty"`
Sports *[]string `json:"sports,omitempty" bson:"sports,omitempty"`
Visibility *string `json:"visibility,omitempty" bson:"visibility"`
AcceptedEULA *bool `json:"accepted_eula,omitempty" bson:"accepted_eula,omitempty"`
HasOnboarded *bool `json:"has_onboarded,omitempty" bson:"has_onboarded,omitempty"`
BlockedUsers *[]string `json:"blocked_users,omitempty" bson:"blocked_users,omitempty"`
Hometown *Location `json:"hometown,omitempty" bson:"hometown,omitempty"`
LastLocation *Location `json:"last_location,omitempty" bson:"last_location,omitempty"`
DeviceTokens *[]DeviceToken `json:"device_tokens,omitempty" bson:"device_tokens,omitempty"`
}
// User data to return when looking up info about a user
type UserData struct {
UUID string `json:"uuid" bson:"uuid"`
Username string `json:"username" bson:"username"`
FirstName string `json:"first_name" bson:"first_name"`
LastName string `json:"last_name" bson:"last_name"`
ImageURL string `json:"image_url" bson:"image_url"`
Bio string `json:"bio,omitempty" bson:"bio,omitempty"`
Clubs *[]primitive.ObjectID `json:"clubs,omitempty" bson:"clubs,omitempty"`
Organizations *[]primitive.ObjectID `json:"organizations,omitempty" bson:"organizations,omitempty"`
Sports []string `json:"sports,omitempty" bson:"sports"`
Visibility string `json:"visibility" bson:"visibility"`
AcceptedEULA bool `json:"accepted_eula" bson:"accepted_eula"`
HasOnboarded *bool `json:"has_onboarded,omitempty" bson:"has_onboarded,omitempty"`
BlockedUsers []string `json:"blocked_users" bson:"blocked_users"`
Hometown *Location `json:"hometown,omitempty" bson:"hometown,omitempty"`
LastLocation *Location `json:"last_location,omitempty" bson:"last_location,omitempty"`
DeviceTokens *[]DeviceToken `json:"device_tokens,omitempty" bson:"device_tokens,omitempty"`
}
// Users data response
type UsersDataResponse struct {
TotalUsers int `json:"total_users"`
Users []UserData `json:"users"`
}
type UserSnippet struct {
UUID string `json:"uuid" bson:"uuid"`
Username string `json:"username" bson:"username"`
ImageURL string `json:"image_url" bson:"image_url"`
}