/
dbModel.go
101 lines (91 loc) · 3.44 KB
/
dbModel.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
// Package data contains the data model of this app
package data
import "time"
// StravaUserToken is data from strava_user_token table
type StravaUserToken struct {
UserID string `json:"userId"`
StravaUserID int64 `json:"stravaUserId"`
AppID int64 `json:"appId"`
Token string `json:"token"`
RefreshToken string `json:"refreshToken"`
Active bool `json:"active"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
TokenExpiredAt time.Time `json:"tokenExpiredAt"`
TokenExpiredIn int64 `json:"tokenExpiredIn"`
}
// ActivityQueue is data from activity_queue table
type ActivityQueue struct {
ActivityQueueID int64 `json:"activityQueueId"`
StravaUserID int64 `json:"stravaUserId"`
Active bool `json:"active"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
}
// EventProgress is data from event_progress table
type EventProgress struct {
EventProgressID int64 `json:"eventProgressId"`
EventID int64 `json:"eventId"`
UserID string `json:"userId"`
Active bool `json:"active"`
Distance float64 `json:"distance"`
ElapsedTime float64 `json:"elapsedTime"`
ValidDistance float64 `json:"validDistance"`
ValidElapsedTime float64 `json:"validElapsedTime"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
}
// StravaActivityHistory is data from strava_activity_history table
type StravaActivityHistory struct {
UserID string `json:"userId"`
History string `json:"history"`
HasHistory bool `json:"hasHistory"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
}
// StravaApp is data from strava_app table
type StravaApp struct {
AppID int64 `json:"appId"`
ClientID int64 `json:"clientId"`
ClientSecret string `json:"clientSecret"`
RefreshURL string `json:"refreshUrl"`
AppName string `json:"appName"`
Remark string `json:"remark"`
LoadActivityURL string `json:"loadActivityUrl"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
}
// MyEvent is data from event_register table
type MyEvent struct {
EventRegisterID int64 `json:"eventRegisterId"`
EventID int64 `json:"eventId"`
UserID string `json:"userId"`
}
// RunningEvent is data from running_event table
type RunningEvent struct {
EventID int64 `json:"eventId"`
Name string `json:"name"`
Data string `json:"data"`
RuleID int64 `json:"ruleId"`
}
// RegisterLog is data from register_log table
type RegisterLog struct {
RegisterLogID int64 `json:"registerLogId"`
UserID string `json:"userId"`
EventID int64 `json:"eventId"`
UserInfo string `json:"userInfo"`
Address string `json:"address"`
Item string `json:"item"`
Step int64 `json:"step"`
Active bool `json:"active"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
}
// RuleFunction is data from running_event table
type RuleFunction struct {
RuleID int64 `json:"ruleId"`
FunctionName string `json:"functionName"`
Description string `json:"description"`
CreatedDate time.Time `json:"createdDate"`
UpdatedDate time.Time `json:"updatedDate"`
}