mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-04 06:07:59 +08:00 
			
		
		
		
	refactor: modify method
This commit is contained in:
		@ -43,6 +43,14 @@ public interface WxCpService {
 | 
				
			|||||||
   */
 | 
					   */
 | 
				
			||||||
  public void userAuthenticated(String userId) throws WxErrorException;
 | 
					  public void userAuthenticated(String userId) throws WxErrorException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * 获取access_token, 不强制刷新access_token
 | 
				
			||||||
 | 
					   * @see #getAccessToken(boolean)
 | 
				
			||||||
 | 
					   * @return
 | 
				
			||||||
 | 
					   * @throws WxErrorException
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  public String getAccessToken() throws WxErrorException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * <pre>
 | 
					   * <pre>
 | 
				
			||||||
   * 获取access_token,本方法线程安全
 | 
					   * 获取access_token,本方法线程安全
 | 
				
			||||||
 | 
				
			|||||||
@ -71,6 +71,10 @@ public class WxCpServiceImpl implements WxCpService {
 | 
				
			|||||||
    execute(new SimpleGetRequestExecutor(), url, null);
 | 
					    execute(new SimpleGetRequestExecutor(), url, null);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  public String getAccessToken() throws WxErrorException {
 | 
				
			||||||
 | 
					    return getAccessToken(false);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public String getAccessToken(boolean forceRefresh) throws WxErrorException {
 | 
					  public String getAccessToken(boolean forceRefresh) throws WxErrorException {
 | 
				
			||||||
    if (forceRefresh) {
 | 
					    if (forceRefresh) {
 | 
				
			||||||
      wxCpConfigStorage.expireAccessToken();
 | 
					      wxCpConfigStorage.expireAccessToken();
 | 
				
			||||||
 | 
				
			|||||||
@ -29,6 +29,14 @@ public interface WxMpService {
 | 
				
			|||||||
   */
 | 
					   */
 | 
				
			||||||
  public boolean checkSignature(String timestamp, String nonce, String signature);
 | 
					  public boolean checkSignature(String timestamp, String nonce, String signature);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * 获取access_token, 不强制刷新access_token
 | 
				
			||||||
 | 
					   * @see #getAccessToken(boolean)
 | 
				
			||||||
 | 
					   * @return
 | 
				
			||||||
 | 
					   * @throws WxErrorException
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  public String getAccessToken() throws WxErrorException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * <pre>
 | 
					   * <pre>
 | 
				
			||||||
   * 获取access_token,本方法线程安全
 | 
					   * 获取access_token,本方法线程安全
 | 
				
			||||||
@ -46,6 +54,14 @@ public interface WxMpService {
 | 
				
			|||||||
   */
 | 
					   */
 | 
				
			||||||
  public String getAccessToken(boolean forceRefresh) throws WxErrorException;
 | 
					  public String getAccessToken(boolean forceRefresh) throws WxErrorException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  /**
 | 
				
			||||||
 | 
					   * 获得jsapi_ticket,不强制刷新jsapi_ticket
 | 
				
			||||||
 | 
					   * @see #getJsapiTicket(boolean)
 | 
				
			||||||
 | 
					   * @return
 | 
				
			||||||
 | 
					   * @throws WxErrorException
 | 
				
			||||||
 | 
					   */
 | 
				
			||||||
 | 
					  public String getJsapiTicket() throws WxErrorException;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * <pre>
 | 
					   * <pre>
 | 
				
			||||||
   * 获得jsapi_ticket
 | 
					   * 获得jsapi_ticket
 | 
				
			||||||
 | 
				
			|||||||
@ -69,6 +69,10 @@ public class WxMpServiceImpl implements WxMpService {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  public String getAccessToken() throws WxErrorException {
 | 
				
			||||||
 | 
					    return getAccessToken(false);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public String getAccessToken(boolean forceRefresh) throws WxErrorException {
 | 
					  public String getAccessToken(boolean forceRefresh) throws WxErrorException {
 | 
				
			||||||
    if (forceRefresh) {
 | 
					    if (forceRefresh) {
 | 
				
			||||||
      wxMpConfigStorage.expireAccessToken();
 | 
					      wxMpConfigStorage.expireAccessToken();
 | 
				
			||||||
@ -106,6 +110,9 @@ public class WxMpServiceImpl implements WxMpService {
 | 
				
			|||||||
    return wxMpConfigStorage.getAccessToken();
 | 
					    return wxMpConfigStorage.getAccessToken();
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  public String getJsapiTicket() throws WxErrorException {
 | 
				
			||||||
 | 
					    return getJsapiTicket(false);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public String getJsapiTicket(boolean forceRefresh) throws WxErrorException {
 | 
					  public String getJsapiTicket(boolean forceRefresh) throws WxErrorException {
 | 
				
			||||||
    if (forceRefresh) {
 | 
					    if (forceRefresh) {
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user