Added arn to the main repository

This commit is contained in:
2019-06-03 18:32:43 +09:00
parent cf258573a8
commit 29a48d94a5
465 changed files with 15968 additions and 288 deletions

View File

@ -0,0 +1,43 @@
package arn
// ConnectGoogle connects the user's account with a Google account.
func (user *User) ConnectGoogle(googleID string) {
if googleID == "" {
return
}
user.Accounts.Google.ID = googleID
DB.Set("GoogleToUser", googleID, &GoogleToUser{
ID: googleID,
UserID: user.ID,
})
}
// ConnectFacebook connects the user's account with a Facebook account.
func (user *User) ConnectFacebook(facebookID string) {
if facebookID == "" {
return
}
user.Accounts.Facebook.ID = facebookID
DB.Set("FacebookToUser", facebookID, &FacebookToUser{
ID: facebookID,
UserID: user.ID,
})
}
// ConnectTwitter connects the user's account with a Twitter account.
func (user *User) ConnectTwitter(twtterID string) {
if twtterID == "" {
return
}
user.Accounts.Twitter.ID = twtterID
DB.Set("TwitterToUser", twtterID, &TwitterToUser{
ID: twtterID,
UserID: user.ID,
})
}