Package com.foxinmy.weixin4j.qy
Class WeixinSuiteProxy
- java.lang.Object
-
- com.foxinmy.weixin4j.qy.WeixinSuiteProxy
-
-
Constructor Summary
Constructors Constructor Description WeixinSuiteProxy()
微信第三方套件接口实现(使用weixin4j.properties配置的account账号信息, 使用FileCacheStorager文件方式缓存TOKEN)WeixinSuiteProxy(com.foxinmy.weixin4j.cache.CacheStorager<com.foxinmy.weixin4j.model.Token> cacheStorager)
微信第三方套件接口实现(使用weixin4j.properties配置的account账号信息)WeixinSuiteProxy(WeixinQyAccount weixinQyAccount, com.foxinmy.weixin4j.cache.CacheStorager<com.foxinmy.weixin4j.model.Token> cacheStorager)
微信第三方套件接口实现
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cacheSuiteTicket(String suiteId, String suiteTicket)
缓存套件ticketString
getLoginUrl(String corpId, LoginTargetType targetType, int agentId)
获取登录企业号官网的urlOUserInfo
getOUserInfoByCode(String authCode)
第三方套件获取企业号管理员登录信息String
getPreSuiteTicket(String suiteId)
获取套件的预授权码 需先缓存ticketString
getSuiteAuthorizationURL(String suiteId)
应用套件授权 需先缓存ticket redirectUri默认填写weixin4j.properties#suite.oauth.redirect.uri state默认填写stateString
getSuiteAuthorizationURL(String suiteId, String redirectUri, String state)
应用套件授权 需先缓存ticket,在授权完成之后需要调用SuiteApi#exchangeAuthInfo方法 ,否则无法缓存token相关导致后续的组件接口调用失败WeixinProxy
getWeixinProxy(String suiteId, String authCorpId)
创建WeixinProxy对象WeixinQyAccount
getWeixinQyAccount()
企业号信息SuiteApi
suite()
获取套件接口对象(只关注第一个套件SuiteApi
suite(String suiteId)
获取套件接口对象(多个套件
-
-
-
Field Detail
-
VERSION
public static final String VERSION
-
-
Constructor Detail
-
WeixinSuiteProxy
public WeixinSuiteProxy()
微信第三方套件接口实现(使用weixin4j.properties配置的account账号信息, 使用FileCacheStorager文件方式缓存TOKEN)
-
WeixinSuiteProxy
public WeixinSuiteProxy(com.foxinmy.weixin4j.cache.CacheStorager<com.foxinmy.weixin4j.model.Token> cacheStorager)
微信第三方套件接口实现(使用weixin4j.properties配置的account账号信息)- Parameters:
cacheStorager
- token管理
-
WeixinSuiteProxy
public WeixinSuiteProxy(WeixinQyAccount weixinQyAccount, com.foxinmy.weixin4j.cache.CacheStorager<com.foxinmy.weixin4j.model.Token> cacheStorager)
微信第三方套件接口实现- Parameters:
weixinQyAccount
- 账号信息cacheStorager
- token管理
-
-
Method Detail
-
getWeixinQyAccount
public WeixinQyAccount getWeixinQyAccount()
企业号信息- Returns:
-
suite
public SuiteApi suite(String suiteId)
获取套件接口对象(多个套件- Parameters:
suiteId
- 套件ID- Returns:
- API实例
- See Also:
SuiteApi
-
getPreSuiteTicket
public String getPreSuiteTicket(String suiteId) throws com.foxinmy.weixin4j.exception.WeixinException
获取套件的预授权码 需先缓存ticket- Parameters:
suiteId
- 套件ID- Returns:
- 预授权码
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
cacheSuiteTicket(String, String)
,SuiteApi
,SuiteApi.getTicketManager()
,SuiteApi.getPreCodeManager()
-
cacheSuiteTicket
public void cacheSuiteTicket(String suiteId, String suiteTicket) throws com.foxinmy.weixin4j.exception.WeixinException
缓存套件ticket- Parameters:
suiteId
- 套件IDsuiteTicket
- 套件ticket内容- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
- 推送suite_ticket协议
-
getSuiteAuthorizationURL
public String getSuiteAuthorizationURL(String suiteId) throws com.foxinmy.weixin4j.exception.WeixinException
应用套件授权 需先缓存ticket- redirectUri默认填写weixin4j.properties#suite.oauth.redirect.uri
- state默认填写state
- Parameters:
suiteId
- 套件ID- Returns:
- 请求授权的URL
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
-
getSuiteAuthorizationURL
public String getSuiteAuthorizationURL(String suiteId, String redirectUri, String state) throws com.foxinmy.weixin4j.exception.WeixinException
应用套件授权 需先缓存ticket,在授权完成之后需要调用SuiteApi#exchangeAuthInfo方法 ,否则无法缓存token相关导致后续的组件接口调用失败- Parameters:
suiteId
- 套件IDredirectUri
- 授权后重定向urlstate
- 回调后原样返回- Returns:
- 请求授权的URL
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
cacheSuiteTicket(String, String)
,SuiteApi
,SuiteApi.getTicketManager()
,SuiteApi.getPreCodeManager()
,SuiteApi.exchangeAuthInfo(String)
, 企业号第三方应用套件授权
-
getOUserInfoByCode
public OUserInfo getOUserInfoByCode(String authCode) throws com.foxinmy.weixin4j.exception.WeixinException
第三方套件获取企业号管理员登录信息- Parameters:
authCode
- oauth2.0授权企业号管理员登录产生的code:通过成员授权获取到的code,每次成员授权带上的code将不一样, code只能使用一次,5分钟未被使用自动过期- Returns:
- 登陆信息
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
ProviderApi
, 授权获取企业号管理员登录信息,OUserInfo
-
getLoginUrl
public String getLoginUrl(String corpId, LoginTargetType targetType, int agentId) throws com.foxinmy.weixin4j.exception.WeixinException
获取登录企业号官网的url- Parameters:
corpId
- oauth授权的corpidtargetType
- 登录跳转到企业号后台的目标页面agentId
- 授权方应用id 小余1时则不传递- Returns:
- 登陆URL
- Throws:
com.foxinmy.weixin4j.exception.WeixinException
- See Also:
ProviderApi
, 获取登录企业号官网的url
-
getWeixinProxy
public WeixinProxy getWeixinProxy(String suiteId, String authCorpId)
创建WeixinProxy对象- Parameters:
suiteId
- 套件IDauthCorpId
- 已授权的corpid- Returns:
- See Also:
WeixinProxy
-
-