Documentation ¶
Index ¶
- type API
- type Agent
- type AgentEditInfo
- type AuthInfo
- type CorpAgent
- type CorpAuthInfo
- type Corporation
- type PermanentCodeInfo
- type RecvSuiteAuth
- type RecvSuiteTicket
- type Suite
- func (s *Suite) FetchToken() (token string, expiresIn int64, err error)
- func (s *Suite) GetAuthURI(appIDs []int, redirectURI, state string) (string, error)
- func (s *Suite) GetCorpAuthInfo(corpID, permanentCode string) (CorpAuthInfo, error)
- func (s *Suite) GetCropAgent(corpID, permanentCode, agentID string) (CorpAgent, error)
- func (s *Suite) GetPermanentCode(authCode string) (PermanentCodeInfo, error)
- func (s *Suite) NewAPI(corpID, permanentCode string) *API
- func (s *Suite) Parse(body []byte, signature, timestamp, nonce string) (interface{}, error)
- func (s *Suite) Response(message []byte) ([]byte, error)
- func (s *Suite) Retriable(reqURL string, body []byte) (bool, string, error)
- func (s *Suite) SetTicket(suiteTicket string)
- func (s *Suite) UpdateCorpAgent(corpID, permanentCode string, agent AgentEditInfo) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct { ID int64 `json:"agentid"` Name string `json:"name,omitempty"` RoundLogoURI string `json:"round_logo_url,omitempty"` SquareLogoURI string `json:"square_logo_url,omitempty"` Description string `json:"description,omitempty"` RedirectDomain string `json:"redirect_domain,omitempty"` RedirectLocationFlag int64 `json:"report_location_flag,omitempty"` IsReportUser int64 `json:"isreportuser,omitempty"` IsReportEnter int64 `json:"isreportenter,omitempty"` }
Agent 用于表示应用基本信息
type AgentEditInfo ¶
AgentEditInfo 代表设置授权方企业号某个应用时的应用信息
type AuthInfo ¶
type AuthInfo struct { Agent []*authorizedAgent `json:"agent"` Department []*authorizedDepartment `json:"department"` }
AuthInfo 表示授权基本信息
type CorpAgent ¶
type CorpAgent struct { Agent AllowUsers *allowUsers `json:"allow_userinfos"` AllowPartys *allowPartys `json:"allow_partys"` AllowTags *allowTags `json:"allow_tags"` Close int64 `json:"close"` }
CorpAgent 用于表示授权方企业号某个应用的基本信息
type CorpAuthInfo ¶
type CorpAuthInfo struct { AuthCorpInfo *Corporation `json:"auth_corp_info"` AuthInfo *AuthInfo `json:"auth_info"` AuthUserInfo *operator `json:"auth_user_info"` }
CorpAuthInfo 代表企业号的授权信息
type Corporation ¶
type Corporation struct { ID string `json:"corpid"` Name string `json:"corp_name"` Type string `json:"corp_type"` RoundLogoURI string `json:"corp_round_logo_url"` SquareLogoURI string `json:"corp_square_logo_url"` UserMax int `json:"corp_user_max"` AgentMax int `json:"corp_agent_max"` QRCode string `json:"corp_wxqrcode"` }
Corporation 用于表示授权方企业信息
type PermanentCodeInfo ¶
type PermanentCodeInfo struct { AccessToken string `json:"access_token"` ExpiresIn int64 `json:"expires_in"` PermanentCode string `json:"permanent_code"` AuthCorpInfo *Corporation `json:"auth_corp_info"` AuthInfo *AuthInfo `json:"auth_info"` }
PermanentCodeInfo 代表获取企业号永久授权码时的响应信息
type RecvSuiteAuth ¶
RecvSuiteAuth 用于记录应用套件授权变更和授权撤销的被动响应结果
type RecvSuiteTicket ¶
RecvSuiteTicket 用于记录应用套件 ticket 的被动响应结果
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite 结构体包含了应用套件的相关操作
func (*Suite) FetchToken ¶
FetchToken 方法用于向 API 服务器获取套件的令牌信息
func (*Suite) GetAuthURI ¶
GetAuthURI 方法用于获取应用套件的授权地址
func (*Suite) GetCorpAuthInfo ¶
func (s *Suite) GetCorpAuthInfo(corpID, permanentCode string) (CorpAuthInfo, error)
GetCorpAuthInfo 方法用于获取已授权当前套件的企业号的授权信息
func (*Suite) GetCropAgent ¶
GetCropAgent 方法用于获取已授权当前套件的企业号的某个应用信息
func (*Suite) GetPermanentCode ¶
func (s *Suite) GetPermanentCode(authCode string) (PermanentCodeInfo, error)
GetPermanentCode 方法用于获取企业的永久授权码
func (*Suite) UpdateCorpAgent ¶
func (s *Suite) UpdateCorpAgent(corpID, permanentCode string, agent AgentEditInfo) error
UpdateCorpAgent 方法用于设置已授权当前套件的企业号的某个应用信息
Click to show internal directories.
Click to hide internal directories.