-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.go
63 lines (49 loc) · 1.45 KB
/
default.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
package socialite
import (
"errors"
)
// ISocialite interface
type ISocialite interface {
// GetAuthorizeURL get authorize url
GetAuthorizeURL(args ...string) string
// Token get token
Token(code string) (interface{}, error)
// RefreshToken refresh token
RefreshToken(refreshToken string) (interface{}, error)
// GetMe get open_id if it needs necessarily
GetMe(accessToken string) (interface{}, error)
// GetUserInfo get user info
GetUserInfo(accessToken, openID string) (interface{}, error)
}
// RespToken struct
type RespToken struct {
Code int `json:"code"`
Msg string `json:"msg"`
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
RefreshToken string `json:"refresh_token"`
OpenID string `json:"openid"`
}
// Default struct
type Default struct{
}
// GetAuthorizeURL get authorize url
func (d *Default) GetAuthorizeURL(args ...string) string {
return "invalid"
}
// Token token
func (d *Default) Token(code string) (interface{}, error) {
return nil, errors.New("invalid")
}
// RefreshToken refresh token
func (d *Default) RefreshToken(refreshToken string) (interface{}, error) {
return nil, errors.New("invalid")
}
// GetMe get me
func (d *Default) GetMe(accessToken string) (interface{}, error) {
return nil, errors.New("can not support")
}
// GetUserInfo get user info
func (d *Default) GetUserInfo(accessToken, openID string) (interface{}, error) {
return nil, errors.New("invalid")
}