Documentation
¶
Index ¶
- type AuthorizeOptions
- type AuthorizeSchema
- type Client
- func (r *Client) Authorize(options AuthorizeOptions) (info AuthorizeSchema, err error)
- func (r *Client) GetTicket() (info TicketSchema, err error)
- func (r *Client) GetUserDetail(options GetUserDetailOptions) (info GetUserDetailSchema, err error)
- func (r *Client) Getuserinfo(options GetuserinfoOptions) (info GetuserinfoSchema, err error)
- func (r *Client) QrConnect(options QrConnectOptions) (info QrConnectSchema, err error)
- type Error
- type GetUserDetailOptions
- type GetUserDetailSchema
- type GetuserinfoOptions
- type GetuserinfoSchema
- type QrConnectOptions
- type QrConnectSchema
- type TicketSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizeOptions ¶
type AuthorizeOptions struct { RedirectUri string `json:"redirect_uri"` CorpId string `json:"corp_id"` }
AuthorizeOptions 获取授权链接请求参数
type AuthorizeSchema ¶
type AuthorizeSchema struct { util.CommonError AuthorizeUrl string `json:"authorize_url"` }
AuthorizeSchema 获取授权链接响应内容
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client OAuth2实例
func (*Client) Authorize ¶
func (r *Client) Authorize(options AuthorizeOptions) (info AuthorizeSchema, err error)
Authorize 获取授权链接
func (*Client) GetTicket ¶
func (r *Client) GetTicket() (info TicketSchema, err error)
func (*Client) GetUserDetail ¶
func (r *Client) GetUserDetail(options GetUserDetailOptions) (info GetUserDetailSchema, err error)
func (*Client) Getuserinfo ¶
func (r *Client) Getuserinfo(options GetuserinfoOptions) (info GetuserinfoSchema, err error)
Getuserinfo 获取用户信息
func (*Client) QrConnect ¶
func (r *Client) QrConnect(options QrConnectOptions) (info QrConnectSchema, err error)
QrConnect 获取二维码链接
type Error ¶
type Error string
Error 错误
const ( // SDKInitFailed 错误码:50001 SDKInitFailed Error = "SDK初始化失败" SDKCacheUnavailable Error = "缓存无效" // SDKUnknownError 错误码:50003 SDKUnknownError Error = "未知错误" // SDKInvalidCredential 错误码:40001 SDKInvalidCredential Error = "不合法的secret参数" // SDKInvalidCorpID 错误码:40013 SDKInvalidCorpID Error = "无效的 CorpID" // SDKAccessTokenInvalid 错误码:40014 SDKAccessTokenInvalid Error = "AccessToken 无效" // SDKValidateSignatureFailed 错误码:40015 SDKValidateSignatureFailed Error = "校验签名错误" // SDKDecryptMSGFailed 错误码:40016 SDKDecryptMSGFailed Error = "消息解密失败" // SDKAccessTokenMissing 错误码:41001 SDKAccessTokenMissing Error = "缺少AccessToken参数" // SDKAccessTokenExpired 错误码:42001 SDKAccessTokenExpired Error = "AccessToken 已过期" // SDKApiFreqOutOfLimit 错误码:45009 SDKApiFreqOutOfLimit Error = "接口请求次数超频" // SDKApiForbidden 错误码:48002 SDKApiForbidden Error = "API 禁止调用" // SDKInvalidOpenKFID 错误码:95000 SDKInvalidOpenKFID Error = "无效的 open_kfid" // SDKOpenKFIDNotExist 错误码:95004 SDKOpenKFIDNotExist Error = "open_kfid 不存在" // SDKWeWorkAlready 错误码:95011 SDKWeWorkAlready Error = "已在企业微信使用微信客服" // SDKNotUseInWeCom 错误码:95012 SDKNotUseInWeCom Error = "未在企业微信使用微信客服" // SDKApiNotOpen 错误码:95017 SDKApiNotOpen Error = "API 功能没有被开启" )
type GetUserDetailOptions ¶
type GetUserDetailOptions struct {
UserTicket string `json:"user_ticket"`
}
type GetUserDetailSchema ¶
type GetUserDetailSchema struct { util.CommonError Userid string `json:"userid"` Name string `json:"name"` Gender string `json:"gender"` Avatar string `json:"avatar"` QrCode string `json:"qr_code"` Mobile string `json:"mobile"` Email string `json:"email"` BizMail string `json:"biz_mail"` Address string `json:"address"` }
type GetuserinfoOptions ¶
type GetuserinfoOptions struct {
Code string `json:"code"`
}
GetuserinfoOptions 获取用户信息请求参数
type GetuserinfoSchema ¶
type GetuserinfoSchema struct { util.CommonError UserId string `json:"UserId"` UserTicket string `json:"user_ticket"` DeviceId string `json:"DeviceId"` OpenId string `json:"OpenId"` ExternalUserid string `json:"external_userid"` }
GetuserinfoSchema 获取用户信息响应内容
type QrConnectOptions ¶
type QrConnectOptions struct { RedirectUri string `json:"redirect_uri"` CorpId string `json:"corp_id"` AgentId string `json:"agent_id"` }
QrConnectOptions 获取二维码链接请求参数
type QrConnectSchema ¶
type QrConnectSchema struct { util.CommonError QrConnectUrl string `json:"qr_connect_url"` }
QrConnectSchema 获取二维码链接响应内容
type TicketSchema ¶
type TicketSchema struct { util.CommonError Ticket string `json:"ticket"` }
Click to show internal directories.
Click to hide internal directories.