Documentation
¶
Index ¶
- type AccessTokenResp
- type Douyin
- func (douyin *Douyin) DecryptUserPhone(encryptedPhone string) (string, error)
- func (douyin *Douyin) GetAssessToken(code string) (*AccessTokenResp, error)
- func (douyin *Douyin) GetUserinfo(accessToken, openid string) (*UserinfoResp, error)
- func (douyin *Douyin) Provide(ctx context.Context) interface{}
- type Option
- type Options
- type UserinfoResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenResp ¶ added in v1.8.0
type AccessTokenResp struct {
Data struct {
AccessToken string `json:"access_token"`
Description string `json:"description"`
ErrorCode int `json:"error_code"`
ExpiresIn string `json:"expires_in"`
OpenId string `json:"open_id"`
RefreshExpiresIn string `json:"refresh_expires_in"`
RefreshToken string `json:"refresh_token"`
Scope string `json:"scope"`
} `json:"data"`
Message string `json:"message"`
Extra struct {
Logid string `json:"logid"`
Now int64 `json:"now"`
} `json:"extra"`
}
AccessTokenResp is the response of access token.
type Douyin ¶
type Douyin struct {
// contains filtered or unexported fields
}
func (*Douyin) DecryptUserPhone ¶ added in v1.8.3
DecryptUserPhone 解密用户手机号 文档 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-management/phone-number-decode-demo
func (*Douyin) GetAssessToken ¶ added in v1.8.0
func (douyin *Douyin) GetAssessToken(code string) (*AccessTokenResp, error)
GetAssessToken 获取授权码 文档 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-permission/get-access-token
func (*Douyin) GetUserinfo ¶ added in v1.8.2
func (douyin *Douyin) GetUserinfo(accessToken, openid string) (*UserinfoResp, error)
GetUserinfo 获取用户信息 文档 https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/account-management/get-account-open-info
type Option ¶
type Option func(*Options)
func WithClientKey ¶ added in v1.8.0
func WithClientSecret ¶ added in v1.8.0
type UserinfoResp ¶ added in v1.8.2
type UserinfoResp struct {
Data struct {
Avatar string `json:"avatar"`
AvatarLarger string `json:"avatar_larger"`
ClientKey string `json:"client_key"`
EAccountRole string `json:"e_account_role"`
ErrorCode int `json:"error_code"`
LogId string `json:"log_id"`
Nickname string `json:"nickname"`
OpenId string `json:"open_id"`
UnionId string `json:"union_id"`
EncryptMobile string `json:"encrypt_mobile"`
Description string `json:"description"`
} `json:"data"`
Extra struct {
Logid string `json:"logid"`
Now int64 `json:"now"`
} `json:"extra"`
Message string `json:"message"`
}
UserinfoResp is the response of user info.
Click to show internal directories.
Click to hide internal directories.