wxwork

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	URLGetToken            = "https://qyapi.weixin.qq.com/cgi-bin/gettoken"
	URLFromCodeGetUserInfo = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo"
)

Functions

This section is empty.

Types

type Response

type Response struct {
	ErrCode        int    `json:"errcode"`         // 返回码
	ErrMsg         string `json:"errmsg"`          // 对返回码的文本描述内容
	ExpiresIN      int64  `json:"expires_in"`      // 有效期
	AccessToken    string `json:"access_token"`    // 认证Token
	ExternalUserID string `json:"external_userid"` // 外部联系人id,当且仅当用户是企业的客户,且跟进人在应用的可见范围内时返回。
	// 如果是第三方应用调用,针对同一个客户,同一个服务商不同应用获取到的id相同
	UserInfo
}

type UserInfo

type UserInfo struct {
	UserID   string `json:"UserId"`   // 成员UserID
	OpenID   string `json:"OpenId"`   // 非企业成员的标识,对当前企业唯一
	DeviceID string `json:"DeviceId"` // 手机设备号
}

type Wechat

type Wechat struct {
	AppID           string `json:"app_id" bson:"app_id"`
	AgentID         string `json:"agent_id" bson:"agent_id"`
	AppSecret       string `json:"app_secret" bson:"app_secret"`
	AccessToken     string
	ExpiresIN       int64 `json:"expires_in"`        // 有效期
	CreateTokenDate int64 `json:"create_token_date"` // 创建时时间
}

func (Wechat) FromCodeGetUserInfo

func (w Wechat) FromCodeGetUserInfo(code, accessToken string) *Response

func (*Wechat) GetAccessToken

func (w *Wechat) GetAccessToken() string

Jump to

Keyboard shortcuts

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