This repository has been archived by the owner on Feb 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.go
81 lines (70 loc) · 2.6 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
75
76
77
78
79
80
81
package main
type IncomingSlackMessage struct {
TeamId string
ChannelId string
UserId string
Text string
}
type OutgoingSlackMessage struct {
ChannelId string
AccessToken string
Text string
AttachmentName string
AttachmentContent []byte
}
type AccessDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
TeamId string `gorm:"size:100;index:idx_teamid_slackuserid"`
SlackToken string `gorm:"size:100"`
StravaToken string `gorm:"size:100"`
SlackUserId string `gorm:"size:100;index:idx_teamid_slackuserid"`
StravaUserId int
}
type BotDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
TeamId string `gorm:"size:100;unique_index"`
BotId string `gorm:"size:100"`
BotAccessToken string `gorm:"size:100"`
}
type JobDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
JobId string `gorm:"size:100"`
TeamId string `gorm:"size:100;index:idx_teamid_channelid_clubid"`
ChannelId string `gorm:"size:100;index:idx_teamid_channelid_clubid"`
ClubId string `gorm:"size:100;index:idx_teamid_channelid_clubid"`
SlackUserId string `gorm:"size:100"`
}
type SentDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
ClubId string `gorm:"size:100;index:idx_clubid_channelid"`
ChannelId string `gorm:"size:100;index:idx_clubid_channelid"`
LastActivityId int
}
// The same model as for the mail service.
type SentCode struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
Recipient string `gorm:"not null;" sql:"type:VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_general_ci"`
Code string `gorm:"not null;unique_index;size:7;"`
Used bool `gorm:"not null;"`
}
type ClubDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
ClubId string `gorm:"size:100;unique;"`
Unit string `gorm:"size:10"`
}
type UserDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
StravaUserId int `gorm:"unique;"`
UserName string `gorm:"size:1000" sql:"type:VARCHAR(1000) CHARACTER SET utf8 COLLATE utf8_general_ci"`
UnlockCode string `gorm:"size:7;"`
}
type UserClubDetails struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
StravaUserId int `gorm:"unique_index:idx_userid_clubid;"`
ClubId string `gorm:"size:100;unique_index:idx_userid_clubid;"`
MessageText string `gorm:"size:1000" sql:"type:VARCHAR(1000) CHARACTER SET utf8 COLLATE utf8_general_ci"`
}
type PendingUnlock struct {
Id int `gorm:"primary_key;AUTO_INCREMENT"`
SlackUserId string `gorm:"size:100;unique"`
}