Browse Source

修复开放平台拼写错误的方法名 updateComponentAccessTokent

master
Binary Wang 6 years ago
parent
commit
3bf866e7ff
5 changed files with 9 additions and 7 deletions
  1. +2
    -2
      weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenConfigStorage.java
  2. +1
    -1
      weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java
  3. +3
    -3
      weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInMemoryConfigStorage.java
  4. +1
    -1
      weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInRedisConfigStorage.java
  5. +2
    -0
      weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java

+ 2
- 2
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/WxOpenConfigStorage.java View File

@@ -37,7 +37,7 @@ public interface WxOpenConfigStorage {


void expireComponentAccessToken(); void expireComponentAccessToken();


void updateComponentAccessTokent(WxOpenComponentAccessToken componentAccessToken);
void updateComponentAccessToken(WxOpenComponentAccessToken componentAccessToken);


String getHttpProxyHost(); String getHttpProxyHost();


@@ -59,7 +59,7 @@ public interface WxOpenConfigStorage {
* @param componentAccessToken 新的accessToken值 * @param componentAccessToken 新的accessToken值
* @param expiresInSeconds 过期时间,以秒为单位 * @param expiresInSeconds 过期时间,以秒为单位
*/ */
void updateComponentAccessTokent(String componentAccessToken, int expiresInSeconds);
void updateComponentAccessToken(String componentAccessToken, int expiresInSeconds);


/** /**
* 是否自动刷新token * 是否自动刷新token


+ 1
- 1
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenComponentServiceImpl.java View File

@@ -124,7 +124,7 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {


String responseContent = this.getWxOpenService().post(API_COMPONENT_TOKEN_URL, jsonObject.toString()); String responseContent = this.getWxOpenService().post(API_COMPONENT_TOKEN_URL, jsonObject.toString());
WxOpenComponentAccessToken componentAccessToken = WxOpenComponentAccessToken.fromJson(responseContent); WxOpenComponentAccessToken componentAccessToken = WxOpenComponentAccessToken.fromJson(responseContent);
getWxOpenConfigStorage().updateComponentAccessTokent(componentAccessToken);
getWxOpenConfigStorage().updateComponentAccessToken(componentAccessToken);
} }
return this.getWxOpenConfigStorage().getComponentAccessToken(); return this.getWxOpenConfigStorage().getComponentAccessToken();
} }


+ 3
- 3
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInMemoryConfigStorage.java View File

@@ -108,8 +108,8 @@ public class WxOpenInMemoryConfigStorage implements WxOpenConfigStorage {
} }


@Override @Override
public void updateComponentAccessTokent(WxOpenComponentAccessToken componentAccessToken) {
updateComponentAccessTokent(componentAccessToken.getComponentAccessToken(), componentAccessToken.getExpiresIn());
public void updateComponentAccessToken(WxOpenComponentAccessToken componentAccessToken) {
updateComponentAccessToken(componentAccessToken.getComponentAccessToken(), componentAccessToken.getExpiresIn());
} }


@Override @Override
@@ -168,7 +168,7 @@ public class WxOpenInMemoryConfigStorage implements WxOpenConfigStorage {
} }


@Override @Override
public void updateComponentAccessTokent(String componentAccessToken, int expiresInSeconds) {
public void updateComponentAccessToken(String componentAccessToken, int expiresInSeconds) {
this.componentAccessToken = componentAccessToken; this.componentAccessToken = componentAccessToken;
this.componentExpiresTime = System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L; this.componentExpiresTime = System.currentTimeMillis() + (expiresInSeconds - 200) * 1000L;
} }


+ 1
- 1
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenInRedisConfigStorage.java View File

@@ -91,7 +91,7 @@ public class WxOpenInRedisConfigStorage extends WxOpenInMemoryConfigStorage {
} }


@Override @Override
public void updateComponentAccessTokent(String componentAccessToken, int expiresInSeconds) {
public void updateComponentAccessToken(String componentAccessToken, int expiresInSeconds) {
try (Jedis jedis = this.jedisPool.getResource()) { try (Jedis jedis = this.jedisPool.getResource()) {
jedis.setex(this.componentAccessTokenKey, expiresInSeconds - 200, componentAccessToken); jedis.setex(this.componentAccessTokenKey, expiresInSeconds - 200, componentAccessToken);
} }


+ 2
- 0
weixin-java-open/src/main/java/me/chanjar/weixin/open/api/impl/WxOpenMaServiceImpl.java View File

@@ -76,6 +76,7 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @return * @return
* @throws WxErrorException * @throws WxErrorException
*/ */
@Override
public WxOpenMaDomainResult modifyDomain(String action, List<String> requestdomainList, List<String> wsrequestdomainList, List<String> uploaddomainList, List<String> downloaddomainList) throws WxErrorException { public WxOpenMaDomainResult modifyDomain(String action, List<String> requestdomainList, List<String> wsrequestdomainList, List<String> uploaddomainList, List<String> downloaddomainList) throws WxErrorException {


// if (!"get".equals(action) && (requestdomainList == null || wsrequestdomainList == null || uploaddomainList == null || downloaddomainList == null)) { // if (!"get".equals(action) && (requestdomainList == null || wsrequestdomainList == null || uploaddomainList == null || downloaddomainList == null)) {
@@ -252,6 +253,7 @@ public class WxOpenMaServiceImpl extends WxMaServiceImpl implements WxOpenMaServ
* @return * @return
* @throws WxErrorException * @throws WxErrorException
*/ */
@Override
public WxOpenMaSubmitAuditResult submitAudit(WxOpenMaSubmitAuditMessage submitAuditMessage) throws WxErrorException { public WxOpenMaSubmitAuditResult submitAudit(WxOpenMaSubmitAuditMessage submitAuditMessage) throws WxErrorException {
String response = post(API_SUBMIT_AUDIT, GSON.toJson(submitAuditMessage)); String response = post(API_SUBMIT_AUDIT, GSON.toJson(submitAuditMessage));
return WxMaGsonBuilder.create().fromJson(response, WxOpenMaSubmitAuditResult.class); return WxMaGsonBuilder.create().fromJson(response, WxOpenMaSubmitAuditResult.class);


Loading…
Cancel
Save