app3

package
v1.8.108 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: Zlib Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthorizerGet added in v1.8.107

func AuthorizerGet(tk token.Token, d data.D) (access.Token, error)

AuthorizerGet 使用授权码获取授权信息

https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/api/authorization_info.html

func ClearQuota

func ClearQuota(api *token.Api) error

ClearQuota 所有api调用(包括第三方帮其调用)次数进行清零,每月10次 https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Official_Accounts/Official_account_interface.html

func GetAuthorizerAccessToken added in v1.8.107

func GetAuthorizerAccessToken(tk token.Token, d data.D) (access.Token, error)

GetAuthorizerAccessToken 获取/刷新接口调用令牌(获取授权账号的authorizer_access_token)

func GetAuthorizerInfo added in v1.8.35

func GetAuthorizerInfo(api *token.Api, authorizerAppId string) (*AuthorizerInfo, *AuthorizationInfo, error)

GetAuthorizerInfo 获取授权方的帐号基本信息 https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/api/api_get_authorizer_info.html

func GetComponentAccessToken

func GetComponentAccessToken(tk token.Token, d data.D) (access.Token, error)

func GetIdService added in v1.0.29

func GetIdService() token.Service

func GetService added in v1.0.29

func GetService() token.Service

func GetTicket added in v1.8.105

func GetTicket(tk token.Token, d data.D) (*token.Ticket, error)

GetTicket 由于获取api_ticket 的api 调用次数非常有限,频繁刷新api_ticket 会导致api调用受限,影响自身业务,开发者需在自己的服务存储与更新api_ticket

func GetWebService added in v1.0.29

func GetWebService() token.Service

func NewIdToken added in v1.0.29

func NewIdToken(app token.App) token.Token

func NewToken

func NewToken(app token.App) token.Token

func NewWebToken added in v1.0.29

func NewWebToken(app token.App) token.Token

func WebGetAccessToken added in v1.8.35

func WebGetAccessToken(tk token.Token, d data.D) (access.Token, error)

WebGetAccessToken https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Official_Accounts/official_account_website_authorization.html 第三方平台可以根据本文档相关说明,代替授权公众号发起网页授权 ?appid=APPID&code=CODE&grant_type=authorization_code&component_appid=COMPONENT_APPID&

func WebRefreshToken added in v1.8.35

func WebRefreshToken(tk token.Token, d data.D) (access.Token, error)

Types

type AccessToken

type AccessToken struct {
	Token     string `json:"component_access_token"`
	ExpiresIn int64  `json:"expires_in"`
}

func (AccessToken) GetAccessToken

func (a AccessToken) GetAccessToken() access.Value

GetAccessToken access.Token interface implement

func (AccessToken) GetRefAccessToken

func (a AccessToken) GetRefAccessToken() access.Value

type Auth added in v1.8.35

type Auth struct {
	AuthorizerAppId        string `json:"authorizer_appid"`
	AuthorizerRefreshToken string `json:"refresh_token"`
	AuthTime               int64  `json:"auth_time"`
}

type AuthorizationInfo added in v1.8.35

type AuthorizationInfo struct {
	Appid        string        `json:"authorizer_appid"`
	AccessToken  string        `json:"authorizer_access_token"`
	RefreshToken string        `json:"authorizer_refresh_token"`
	ExpiresIn    int64         `json:"expires_in"`
	Func         []interface{} `json:"func_info"`
}

func (AuthorizationInfo) GetAccessToken added in v1.8.35

func (a AuthorizationInfo) GetAccessToken() access.Value

GetAccessToken access.Token interface implement

func (AuthorizationInfo) GetRefAccessToken added in v1.8.35

func (a AuthorizationInfo) GetRefAccessToken() access.Value

type AuthorizerInfo added in v1.8.105

type AuthorizerInfo 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"`  //原始 ID
	Alias        string `json:"alias"`      //公众号所设置的微信号,可能为空
	QrcodeUrl    string `json:"qrcode_url"` //二维码图片的 URL,开发者最好自行也进行保存
	BusinessInfo struct {
		OpenPay   int `json:"open_pay"`   //是否开通微信支付功能
		OpenShake int `json:"open_shake"` //是否开通微信摇一摇功能
		OpenScan  int `json:"open_scan"`  //是否开通微信扫商品功能
		OpenCard  int `json:"open_card"`  //是否开通微信卡券功能
		OpenStore int `json:"open_store"` //是否开通微信门店功能
	} `json:"business_info"` //用以了解功能的开通状况(0代表未开通,1代表已开通)
	Idc             int    `json:"idc"`
	PrincipalName   string `json:"principal_name"` //主体名称
	Signature       string `json:"signature"`
	MiniProgramInfo struct {
		Network struct {
			RequestDomain        []string      `json:"RequestDomain"`
			WsRequestDomain      []string      `json:"WsRequestDomain"`
			UploadDomain         []string      `json:"UploadDomain"`
			DownloadDomain       []string      `json:"DownloadDomain"`
			BizDomain            []interface{} `json:"BizDomain"`
			UDPDomain            []interface{} `json:"UDPDomain"`
			TCPDomain            []interface{} `json:"TCPDomain"`
			PrefetchDNSDomain    []interface{} `json:"PrefetchDNSDomain"`
			NewRequestDomain     []interface{} `json:"NewRequestDomain"`
			NewWsRequestDomain   []interface{} `json:"NewWsRequestDomain"`
			NewUploadDomain      []interface{} `json:"NewUploadDomain"`
			NewDownloadDomain    []interface{} `json:"NewDownloadDomain"`
			NewBizDomain         []interface{} `json:"NewBizDomain"`
			NewUDPDomain         []interface{} `json:"NewUDPDomain"`
			NewTCPDomain         []interface{} `json:"NewTCPDomain"`
			NewPrefetchDNSDomain []interface{} `json:"NewPrefetchDNSDomain"`
		} `json:"network"`
		Categories []struct {
			First  string `json:"first"`
			Second string `json:"second"`
		} `json:"categories"`
		VisitStatus int `json:"visit_status"`
	} `json:"MiniProgramInfo"` //小程序配置,根据这个字段判断是否为小程序类型授权
	RegisterType  int `json:"register_type"`  //小程序注册方式
	AccountStatus int `json:"account_status"` //账号状态,该字段小程序也返回
	BasicConfig   struct {
		IsPhoneConfigured bool `json:"is_phone_configured"` //是否已经绑定手机号
		IsEmailConfigured bool `json:"is_email_configured"` //是否已经绑定邮箱,不绑定邮箱账号的不可登录微信公众平台
	} `json:"basic_config"` //基础配置信息
}

type AuthorizerToken added in v1.8.35

type AuthorizerToken struct {
	AuthorizerAppId string `json:"authorizer_appid,omitempty"`
	AcsToken        string `json:"authorizer_access_token"`
	ExpireIn        int64  `json:"expires_in"`
	RefToken        string `json:"authorizer_refresh_token"`
	RefExpireIn     int64  `json:"authorizer_refresh_expires_in,omitempty"`
}

func (AuthorizerToken) GetAccessToken added in v1.8.35

func (a AuthorizerToken) GetAccessToken() access.Value

GetAccessToken access.Token interface implement

func (AuthorizerToken) GetRefAccessToken added in v1.8.35

func (a AuthorizerToken) GetRefAccessToken() access.Value

type ListAuthInfo added in v1.8.35

type ListAuthInfo struct {
	TotalCount int    `json:"total_count"`
	List       []Auth `json:"list"`
}

func GetAuthorizerList added in v1.8.35

func GetAuthorizerList(api *token.Api, offset, count int) (*ListAuthInfo, error)

type PreAuthCode added in v1.8.35

type PreAuthCode struct {
	Code      string `json:"pre_auth_code"`
	ExpiresIn int64  `json:"expires_in"`
}

func GetPreAuthCode added in v1.8.35

func GetPreAuthCode(api *token.Api) (*PreAuthCode, error)

GetPreAuthCode 预授权码(pre_auth_code)是第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL