新增第三方组件ComponentApi
This commit is contained in:
@@ -38,7 +38,6 @@ import com.foxinmy.weixin4j.qy.model.IdParameter;
|
||||
import com.foxinmy.weixin4j.qy.model.Party;
|
||||
import com.foxinmy.weixin4j.qy.model.Tag;
|
||||
import com.foxinmy.weixin4j.qy.model.User;
|
||||
import com.foxinmy.weixin4j.qy.suite.SuitePerCodeManager;
|
||||
import com.foxinmy.weixin4j.qy.suite.WeixinTokenSuiteCreator;
|
||||
import com.foxinmy.weixin4j.qy.token.WeixinTicketCreator;
|
||||
import com.foxinmy.weixin4j.qy.token.WeixinTokenCreator;
|
||||
@@ -47,6 +46,7 @@ import com.foxinmy.weixin4j.qy.type.InviteType;
|
||||
import com.foxinmy.weixin4j.qy.type.KfType;
|
||||
import com.foxinmy.weixin4j.qy.type.UserStatus;
|
||||
import com.foxinmy.weixin4j.setting.Weixin4jSettings;
|
||||
import com.foxinmy.weixin4j.token.PerTicketManager;
|
||||
import com.foxinmy.weixin4j.token.TokenManager;
|
||||
import com.foxinmy.weixin4j.tuple.MpArticle;
|
||||
import com.foxinmy.weixin4j.type.MediaType;
|
||||
@@ -137,21 +137,21 @@ public class WeixinProxy {
|
||||
/**
|
||||
* 第三方套件(永久授权码机制)
|
||||
*
|
||||
* @param perCodeManager
|
||||
* @param perTicketManager
|
||||
* 第三方套件永久授权码
|
||||
* {@link com.foxinmy.weixin4j.qy.api.SuiteApi#getPerCodeManager(String)}
|
||||
* @param perTokenManager
|
||||
* @param suiteTokenManager
|
||||
* 第三方套件凭证token
|
||||
* {@link com.foxinmy.weixin4j.qy.api.SuiteApi#getPerTokenManager(String)}
|
||||
* {@link com.foxinmy.weixin4j.qy.api.SuiteApi#getTokenManager}
|
||||
* @see com.foxinmy.weixin4j.qy.api.SuiteApi
|
||||
* @see WeixinSuiteProxy#getWeixinProxy(String, String)
|
||||
*/
|
||||
public WeixinProxy(SuitePerCodeManager perCodeManager,
|
||||
TokenManager perTokenManager) {
|
||||
this(new TokenManager(new WeixinTokenSuiteCreator(perCodeManager,
|
||||
perTokenManager), perCodeManager.getCacheStorager()));
|
||||
public WeixinProxy(PerTicketManager perTicketManager,
|
||||
TokenManager suiteTokenManager) {
|
||||
this(new TokenManager(new WeixinTokenSuiteCreator(perTicketManager,
|
||||
suiteTokenManager), perTicketManager.getCacheStorager()));
|
||||
this.settings = new Weixin4jSettings<WeixinAccount>(new WeixinAccount(
|
||||
perCodeManager.getAuthCorpId(), null));
|
||||
perTicketManager.getAuthAppId(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,6 +9,7 @@ import java.util.Map;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.model.Consts;
|
||||
import com.foxinmy.weixin4j.model.Token;
|
||||
import com.foxinmy.weixin4j.model.WeixinAccount;
|
||||
import com.foxinmy.weixin4j.qy.api.ProviderApi;
|
||||
import com.foxinmy.weixin4j.qy.api.SuiteApi;
|
||||
@@ -54,8 +55,8 @@ public class WeixinSuiteProxy {
|
||||
* 默认使用文件方式保存token、使用weixin4j.properties配置的账号信息
|
||||
*/
|
||||
public WeixinSuiteProxy() {
|
||||
this(new Weixin4jSettings<WeixinQyAccount>(
|
||||
JSON.parseObject(Weixin4jConfigUtil.getValue("account"), WeixinQyAccount.class)));
|
||||
this(new Weixin4jSettings<WeixinQyAccount>(JSON.parseObject(
|
||||
Weixin4jConfigUtil.getValue("account"), WeixinQyAccount.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -70,15 +71,18 @@ public class WeixinSuiteProxy {
|
||||
this.suiteMap = new HashMap<String, SuiteApi>(suites.size());
|
||||
for (WeixinAccount suite : suites) {
|
||||
this.suiteMap.put(suite.getId(), new SuiteApi(
|
||||
new TicketManager(suite.getId(), suite.getSecret(), settings.getCacheStorager0())));
|
||||
new TicketManager(suite.getId(), suite.getSecret(),
|
||||
settings.getCacheStorager0())));
|
||||
}
|
||||
this.suiteMap.put(null, suiteMap.get(suites.get(0).getId()));
|
||||
}
|
||||
if (StringUtil.isNotBlank(settings.getAccount().getId())
|
||||
&& StringUtil.isNotBlank(settings.getAccount().getProviderSecret())) {
|
||||
&& StringUtil.isNotBlank(settings.getAccount()
|
||||
.getProviderSecret())) {
|
||||
this.providerApi = new ProviderApi(
|
||||
new TokenManager(new WeixinProviderTokenCreator(settings.getAccount().getId(),
|
||||
settings.getAccount().getProviderSecret()), settings.getCacheStorager0()),
|
||||
new TokenManager(new WeixinProviderTokenCreator(settings
|
||||
.getAccount().getId(), settings.getAccount()
|
||||
.getProviderSecret()), settings.getCacheStorager0()),
|
||||
settings.getCacheStorager0());
|
||||
}
|
||||
}
|
||||
@@ -114,6 +118,24 @@ public class WeixinSuiteProxy {
|
||||
return this.suiteMap.get(suiteId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取套件的预授权码
|
||||
*
|
||||
* @param suiteId
|
||||
* 套件ID
|
||||
* @return 预授权码
|
||||
* @see com.foxinmy.weixin4j.qy.api.SuiteApi
|
||||
* @see com.foxinmy.weixin4j.qy.api.SuiteApi#getPreCodeManager()
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String preSuiteTicket(String suiteId) throws WeixinException {
|
||||
Token token = suite(suiteId).getTicketManager().getTicket();
|
||||
if (token == null || StringUtil.isBlank(token.getAccessToken())) {
|
||||
throw new WeixinException("maybe oauth first?");
|
||||
}
|
||||
return token.getAccessToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存套件ticket(多个套件
|
||||
*
|
||||
@@ -126,7 +148,8 @@ public class WeixinSuiteProxy {
|
||||
* 推送suite_ticket协议</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public void cacheTicket(String suiteId, String suiteTicket) throws WeixinException {
|
||||
public void cacheTicket(String suiteId, String suiteTicket)
|
||||
throws WeixinException {
|
||||
suite(suiteId).getTicketManager().cachingTicket(suiteTicket);
|
||||
}
|
||||
|
||||
@@ -141,7 +164,8 @@ public class WeixinSuiteProxy {
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String getSuiteAuthorizeURL(String suiteId) throws WeixinException {
|
||||
String redirectUri = Weixin4jConfigUtil.getValue("suite.oauth.redirect.uri");
|
||||
String redirectUri = Weixin4jConfigUtil
|
||||
.getValue("suite.oauth.redirect.uri");
|
||||
return getSuiteAuthorizeURL(suiteId, redirectUri, "state");
|
||||
}
|
||||
|
||||
@@ -161,9 +185,11 @@ public class WeixinSuiteProxy {
|
||||
* @return 请求授权的URL
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String getSuiteAuthorizeURL(String suiteId, String redirectUri, String state) throws WeixinException {
|
||||
public String getSuiteAuthorizeURL(String suiteId, String redirectUri,
|
||||
String state) throws WeixinException {
|
||||
try {
|
||||
return String.format(URLConsts.SUITE_OAUTH_URL, suiteId, suite(suiteId).getTicketManager().getTicket(),
|
||||
return String.format(URLConsts.SUITE_OAUTH_URL, suiteId,
|
||||
suite(suiteId).getTicketManager().getTicket(),
|
||||
URLEncoder.encode(redirectUri, Consts.UTF_8.name()), state);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
;
|
||||
@@ -205,7 +231,8 @@ public class WeixinSuiteProxy {
|
||||
* 获取登录企业号官网的url</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String getLoginUrl(String corpId, LoginTargetType targetType, int agentId) throws WeixinException {
|
||||
public String getLoginUrl(String corpId, LoginTargetType targetType,
|
||||
int agentId) throws WeixinException {
|
||||
return providerApi.getLoginUrl(corpId, targetType, agentId);
|
||||
}
|
||||
|
||||
@@ -220,8 +247,8 @@ public class WeixinSuiteProxy {
|
||||
* @return
|
||||
*/
|
||||
public WeixinProxy getWeixinProxy(String suiteId, String authCorpId) {
|
||||
return new WeixinProxy(suite(suiteId).getPerCodeManager(authCorpId),
|
||||
suite(suiteId).getPerTokenManager(authCorpId));
|
||||
return new WeixinProxy(suite(suiteId).getPerTicketManager(authCorpId),
|
||||
suite(suiteId).getTokenManager());
|
||||
}
|
||||
|
||||
public final static String VERSION = "1.7.0";
|
||||
|
||||
@@ -10,10 +10,10 @@ import com.foxinmy.weixin4j.qy.model.AgentInfo;
|
||||
import com.foxinmy.weixin4j.qy.model.AgentSetter;
|
||||
import com.foxinmy.weixin4j.qy.model.OUserInfo;
|
||||
import com.foxinmy.weixin4j.qy.model.User;
|
||||
import com.foxinmy.weixin4j.qy.suite.SuitePerCodeManager;
|
||||
import com.foxinmy.weixin4j.qy.suite.WeixinSuitePreCodeCreator;
|
||||
import com.foxinmy.weixin4j.qy.suite.WeixinSuiteTokenCreator;
|
||||
import com.foxinmy.weixin4j.qy.suite.WeixinTokenSuiteCreator;
|
||||
import com.foxinmy.weixin4j.token.PerTicketManager;
|
||||
import com.foxinmy.weixin4j.token.TicketManager;
|
||||
import com.foxinmy.weixin4j.token.TokenCreator;
|
||||
import com.foxinmy.weixin4j.token.TokenManager;
|
||||
@@ -51,9 +51,8 @@ public class SuiteApi extends QyApi {
|
||||
this.ticketManager = ticketManager;
|
||||
this.tokenManager = new TokenManager(new WeixinSuiteTokenCreator(
|
||||
ticketManager), ticketManager.getCacheStorager());
|
||||
this.preCodeManager = new TokenManager(
|
||||
new WeixinSuitePreCodeCreator(tokenManager,
|
||||
ticketManager.getId()),
|
||||
this.preCodeManager = new TokenManager(new WeixinSuitePreCodeCreator(
|
||||
tokenManager, ticketManager.getThirdId()),
|
||||
ticketManager.getCacheStorager());
|
||||
}
|
||||
|
||||
@@ -91,9 +90,9 @@ public class SuiteApi extends QyApi {
|
||||
* 授权方corpid
|
||||
* @return
|
||||
*/
|
||||
public SuitePerCodeManager getPerCodeManager(String authCorpId) {
|
||||
return new SuitePerCodeManager(authCorpId,
|
||||
ticketManager.getId(),
|
||||
public PerTicketManager getPerTicketManager(String authCorpId) {
|
||||
return new PerTicketManager(authCorpId, ticketManager.getThirdId(),
|
||||
ticketManager.getThirdSecret(),
|
||||
ticketManager.getCacheStorager());
|
||||
}
|
||||
|
||||
@@ -106,7 +105,7 @@ public class SuiteApi extends QyApi {
|
||||
*/
|
||||
public TokenManager getPerTokenManager(String authCorpId) {
|
||||
return new TokenManager(new WeixinTokenSuiteCreator(
|
||||
getPerCodeManager(authCorpId), tokenManager),
|
||||
getPerTicketManager(authCorpId), tokenManager),
|
||||
ticketManager.getCacheStorager());
|
||||
}
|
||||
|
||||
@@ -130,8 +129,7 @@ public class SuiteApi extends QyApi {
|
||||
para.put("session_info", appid);
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(suite_set_session_uri,
|
||||
tokenManager.getAccessToken()),
|
||||
para.toJSONString());
|
||||
tokenManager.getAccessToken()), para.toJSONString());
|
||||
return response.getAsJsonResult();
|
||||
}
|
||||
|
||||
@@ -151,28 +149,26 @@ public class SuiteApi extends QyApi {
|
||||
throws WeixinException {
|
||||
String suite_get_permanent_uri = getRequestUri("suite_get_permanent_uri");
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("suite_id", ticketManager.getId());
|
||||
obj.put("suite_id", ticketManager.getThirdId());
|
||||
obj.put("auth_code", authCode);
|
||||
WeixinResponse response = weixinExecutor
|
||||
.post(String.format(suite_get_permanent_uri,
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(suite_get_permanent_uri,
|
||||
tokenManager.getAccessToken()), obj.toJSONString());
|
||||
obj = response.getAsJson();
|
||||
obj.put("corp_info", obj.remove("auth_corp_info"));
|
||||
obj.put("user_info", obj.remove("auth_user_info"));
|
||||
OUserInfo oInfo = JSON.toJavaObject(obj, OUserInfo.class);
|
||||
// 微信授权企业号的永久授权码
|
||||
SuitePerCodeManager suitePerCodeManager = getPerCodeManager(oInfo
|
||||
PerTicketManager perTicketManager = getPerTicketManager(oInfo
|
||||
.getCorpInfo().getCorpId());
|
||||
// 缓存微信企业号access_token
|
||||
// 缓存微信企业号的access_token
|
||||
TokenCreator tokenCreator = new WeixinTokenSuiteCreator(
|
||||
suitePerCodeManager, tokenManager);
|
||||
perTicketManager, tokenManager);
|
||||
Token token = new Token(obj.getString("access_token"),
|
||||
obj.getLongValue("expires_in") * 1000l);
|
||||
ticketManager.getCacheStorager()
|
||||
.caching(tokenCreator.key(), token);
|
||||
// 缓存微信企业号永久授权码
|
||||
suitePerCodeManager.cachingPermanentCode(obj
|
||||
.getString("permanent_code"));
|
||||
ticketManager.getCacheStorager().caching(tokenCreator.key(), token);
|
||||
// 缓存微信企业号的永久授权码
|
||||
perTicketManager.cachingTicket(obj.getString("permanent_code"));
|
||||
return oInfo;
|
||||
}
|
||||
|
||||
@@ -190,12 +186,11 @@ public class SuiteApi extends QyApi {
|
||||
public OUserInfo getOAuthInfo(String authCorpId) throws WeixinException {
|
||||
String suite_get_authinfo_uri = getRequestUri("suite_get_authinfo_uri");
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("suite_id", ticketManager.getId());
|
||||
obj.put("suite_id", ticketManager.getThirdId());
|
||||
obj.put("auth_corpid", authCorpId);
|
||||
obj.put("permanent_code", getPerCodeManager(authCorpId)
|
||||
.getPermanentCode());
|
||||
WeixinResponse response = weixinExecutor
|
||||
.post(String.format(suite_get_authinfo_uri,
|
||||
obj.put("permanent_code", getPerTicketManager(authCorpId).getAccessTicket());
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(suite_get_authinfo_uri,
|
||||
tokenManager.getAccessToken()), obj.toJSONString());
|
||||
obj = response.getAsJson();
|
||||
obj.put("corp_info", obj.remove("auth_corp_info"));
|
||||
@@ -220,13 +215,12 @@ public class SuiteApi extends QyApi {
|
||||
throws WeixinException {
|
||||
String suite_get_agent_uri = getRequestUri("suite_get_agent_uri");
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("suite_id", ticketManager.getId());
|
||||
obj.put("suite_id", ticketManager.getThirdId());
|
||||
obj.put("auth_corpid", authCorpId);
|
||||
obj.put("permanent_code", getPerCodeManager(authCorpId)
|
||||
.getPermanentCode());
|
||||
obj.put("permanent_code", getPerTicketManager(authCorpId).getAccessTicket());
|
||||
obj.put("agentid", agentid);
|
||||
WeixinResponse response = weixinExecutor
|
||||
.post(String.format(suite_get_agent_uri,
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(suite_get_agent_uri,
|
||||
tokenManager.getAccessToken()), obj.toJSONString());
|
||||
JSONObject jsonObj = response.getAsJson();
|
||||
AgentInfo agent = JSON.toJavaObject(jsonObj, AgentInfo.class);
|
||||
@@ -258,10 +252,9 @@ public class SuiteApi extends QyApi {
|
||||
throws WeixinException {
|
||||
String suite_set_agent_uri = getRequestUri("suite_set_agent_uri");
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("suite_id", ticketManager.getId());
|
||||
obj.put("suite_id", ticketManager.getThirdId());
|
||||
obj.put("auth_corpid", authCorpId);
|
||||
obj.put("permanent_code", getPerCodeManager(authCorpId)
|
||||
.getPermanentCode());
|
||||
obj.put("permanent_code", getPerTicketManager(authCorpId).getAccessTicket());
|
||||
obj.put("agent", agentSet);
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(suite_set_agent_uri,
|
||||
|
||||
@@ -1,73 +0,0 @@
|
||||
package com.foxinmy.weixin4j.qy.suite;
|
||||
|
||||
import com.foxinmy.weixin4j.cache.CacheStorager;
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.model.Token;
|
||||
import com.foxinmy.weixin4j.token.TokenCreator;
|
||||
|
||||
/**
|
||||
* 应用套件永久授权码的存取
|
||||
*
|
||||
* @className SuitePerCodeManager
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2015年6月22日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
*/
|
||||
public class SuitePerCodeManager {
|
||||
|
||||
private final String authCorpId;
|
||||
private final String suiteId;
|
||||
private final CacheStorager<Token> cacheStorager;
|
||||
|
||||
public SuitePerCodeManager(String authCorpId, String suiteId,
|
||||
CacheStorager<Token> cacheStorager) {
|
||||
this.authCorpId = authCorpId;
|
||||
this.suiteId = suiteId;
|
||||
this.cacheStorager = cacheStorager;
|
||||
}
|
||||
|
||||
/**
|
||||
* 缓存永久授权码
|
||||
*
|
||||
* @param permanentCode
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public void cachingPermanentCode(String permanentCode)
|
||||
throws WeixinException {
|
||||
Token token = new Token(permanentCode);
|
||||
cacheStorager.caching(getCacheKey(), token);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取永久授权码的key
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCacheKey() {
|
||||
return String.format("%sqy_suite_percode_%s_%s",
|
||||
TokenCreator.CACHEKEY_PREFIX, suiteId, authCorpId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查找永久授权码
|
||||
*
|
||||
* @return
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public String getPermanentCode() throws WeixinException {
|
||||
return cacheStorager.lookup(getCacheKey()).getAccessToken();
|
||||
}
|
||||
|
||||
public String getSuiteId() {
|
||||
return this.suiteId;
|
||||
}
|
||||
|
||||
public String getAuthCorpId() {
|
||||
return this.authCorpId;
|
||||
}
|
||||
|
||||
public CacheStorager<Token> getCacheStorager() {
|
||||
return this.cacheStorager;
|
||||
}
|
||||
}
|
||||
+4
-4
@@ -34,15 +34,15 @@ public class WeixinSuiteTokenCreator extends TokenCreator {
|
||||
|
||||
@Override
|
||||
public String key0() {
|
||||
return String.format("qy_suite_token_%s", ticketManager.getId());
|
||||
return String.format("qy_suite_token_%s", ticketManager.getThirdId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Token create() throws WeixinException {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("suite_id", ticketManager.getId());
|
||||
obj.put("suite_secret", ticketManager.getSecret());
|
||||
obj.put("suite_ticket", ticketManager.getTicket());
|
||||
obj.put("suite_id", ticketManager.getThirdId());
|
||||
obj.put("suite_secret", ticketManager.getThirdSecret());
|
||||
obj.put("suite_ticket", ticketManager.getAccessTicket());
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
URLConsts.SUITE_TOKEN_URL, obj.toJSONString());
|
||||
obj = response.getAsJson();
|
||||
|
||||
+12
-11
@@ -5,6 +5,7 @@ import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.http.weixin.WeixinResponse;
|
||||
import com.foxinmy.weixin4j.model.Token;
|
||||
import com.foxinmy.weixin4j.qy.type.URLConsts;
|
||||
import com.foxinmy.weixin4j.token.PerTicketManager;
|
||||
import com.foxinmy.weixin4j.token.TokenCreator;
|
||||
import com.foxinmy.weixin4j.token.TokenManager;
|
||||
|
||||
@@ -22,36 +23,36 @@ import com.foxinmy.weixin4j.token.TokenManager;
|
||||
*/
|
||||
public class WeixinTokenSuiteCreator extends TokenCreator {
|
||||
|
||||
private final SuitePerCodeManager perCodeManager;
|
||||
private final PerTicketManager perTicketManager;
|
||||
private final TokenManager suiteTokenManager;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param perCodeManager
|
||||
* @param perTicketManager
|
||||
* 第三方套件永久授权码
|
||||
* @param suitetokenManager
|
||||
* @param suiteTokenManager
|
||||
* 第三方套件凭证token
|
||||
*/
|
||||
public WeixinTokenSuiteCreator(SuitePerCodeManager perCodeManager,
|
||||
public WeixinTokenSuiteCreator(PerTicketManager perTicketManager,
|
||||
TokenManager suiteTokenManager) {
|
||||
this.perCodeManager = perCodeManager;
|
||||
this.perTicketManager = perTicketManager;
|
||||
this.suiteTokenManager = suiteTokenManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key0() {
|
||||
return String.format("qy_token_suite_%s_%s",
|
||||
perCodeManager.getSuiteId(), perCodeManager.getAuthCorpId());
|
||||
perTicketManager.getThirdId(), perTicketManager.getAuthAppId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Token create() throws WeixinException {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("suite_id", perCodeManager.getSuiteId());
|
||||
obj.put("auth_corpid", perCodeManager.getAuthCorpId());
|
||||
obj.put("permanent_code", perCodeManager.getPermanentCode());
|
||||
WeixinResponse response = weixinExecutor
|
||||
.post(String.format(URLConsts.TOKEN_SUITE_URL,
|
||||
obj.put("suite_id", perTicketManager.getThirdId());
|
||||
obj.put("auth_corpid", perTicketManager.getAuthAppId());
|
||||
obj.put("permanent_code", perTicketManager.getAccessTicket());
|
||||
WeixinResponse response = weixinExecutor.post(
|
||||
String.format(URLConsts.TOKEN_SUITE_URL,
|
||||
suiteTokenManager.getAccessToken()), obj.toJSONString());
|
||||
obj = response.getAsJson();
|
||||
return new Token(obj.getString("access_token"),
|
||||
|
||||
Reference in New Issue
Block a user