Documentation
¶
Index ¶
- Constants
- type AuthType
- type AuthorizationInfo
- type AuthorizationInfoBody
- type Authorizer
- func (authorizer *Authorizer) AuthorizationInfo(authCode string) (*AuthorizationInfo, error)
- func (authorizer *Authorizer) AuthorizerInfo(appId string) (*Info, error)
- func (authorizer *Authorizer) MobilePreAuthorizationUrl(callbackUrl string, authType AuthType) (string, error)
- func (authorizer *Authorizer) PreAuthorizationUrl(callbackUrl string, authType AuthType) (string, error)
- type Categories
- type FuncInfo
- type Info
- type InfoBody
- type MiniProgramInfo
- type PreAuthCode
Constants ¶
View Source
const ( AuthOfficial = 1 // 授权页仅展示公众号 AuthMiniProgram = 2 // 授权页仅展示小程序 AuthAll = 3 // 授权页展示小程序与公众号 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationInfo ¶
type AuthorizationInfo struct {
AuthorizationInfo AuthorizationInfoBody `json:"authorization_info"`
}
AuthorizationInfo 授权信息
type AuthorizationInfoBody ¶
type Authorizer ¶
type Authorizer struct {
// contains filtered or unexported fields
}
Authorizer 公众账号授权
func New ¶
func New(account contracts.AccountInterface) *Authorizer
func (*Authorizer) AuthorizationInfo ¶
func (authorizer *Authorizer) AuthorizationInfo(authCode string) (*AuthorizationInfo, error)
AuthorizationInfo 使用授权码获取授权信息
func (*Authorizer) AuthorizerInfo ¶
func (authorizer *Authorizer) AuthorizerInfo(appId string) (*Info, error)
AuthorizerInfo 获取授权帐号详情
func (*Authorizer) MobilePreAuthorizationUrl ¶
func (authorizer *Authorizer) MobilePreAuthorizationUrl(callbackUrl string, authType AuthType) (string, error)
MobilePreAuthorizationUrl 获取移动端公众账号授权链接
func (*Authorizer) PreAuthorizationUrl ¶
func (authorizer *Authorizer) PreAuthorizationUrl(callbackUrl string, authType AuthType) (string, error)
PreAuthorizationUrl 获取公众账号授权链接
type Categories ¶
type Info ¶
type Info struct {
AuthorizationInfo AuthorizationInfoBody `json:"authorization_info"`
// 授权账号详情信息
AuthorizerInfo InfoBody `json:"authorizer_info"`
}
Info 授权账号详情信息
type InfoBody ¶
type InfoBody struct {
// 通用字段
Nickname string `json:"nick_name"`
HeadImg string `json:"head_img"`
ServiceTypeInfo struct {
Id int `json:"id"`
} `json:"service_type_info"`
VerifyTypeInfo struct {
Id int `json:"id"`
} `json:"verify_type_info"`
Username string `json:"user_name"`
PrincipalName string `json:"principal_name"`
BusinessInfo map[string]int `json:"business_info"`
Alias string `json:"alias"`
QrcodeUrl string `json:"qrcode_url"`
AccountStatus int `json:"account_status"`
Idc int `json:"idc"`
Signature string `json:"signature"`
// 小程序独有字段
RegisterType int `json:"register_type"`
BasicConfig map[string]bool `json:"basic_config"`
MiniProgramInfo *MiniProgramInfo `json:"MiniProgramInfo"`
}
type MiniProgramInfo ¶
type MiniProgramInfo struct {
Network map[string][]string `json:"network"`
Categories []Categories `json:"categories"`
VisitStatus int `json:"visit_status"`
}
type PreAuthCode ¶
type PreAuthCode struct {
PreAuthCode string `json:"pre_auth_code"`
ExpiresIn int64 `json:"expires_in"`
}
PreAuthCode 预授权码
Click to show internal directories.
Click to hide internal directories.