mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-11-02 04:29:48 +08:00
代码优化,由IDEA自动进行的Code Cleanup
This commit is contained in:
@ -12,61 +12,61 @@ import java.io.File;
|
||||
*/
|
||||
public interface WxCpConfigStorage {
|
||||
|
||||
public String getAccessToken();
|
||||
String getAccessToken();
|
||||
|
||||
public boolean isAccessTokenExpired();
|
||||
boolean isAccessTokenExpired();
|
||||
|
||||
/**
|
||||
* 强制将access token过期掉
|
||||
*/
|
||||
public void expireAccessToken();
|
||||
void expireAccessToken();
|
||||
|
||||
public void updateAccessToken(WxAccessToken accessToken);
|
||||
void updateAccessToken(WxAccessToken accessToken);
|
||||
|
||||
public void updateAccessToken(String accessToken, int expiresIn);
|
||||
void updateAccessToken(String accessToken, int expiresIn);
|
||||
|
||||
public String getJsapiTicket();
|
||||
String getJsapiTicket();
|
||||
|
||||
public boolean isJsapiTicketExpired();
|
||||
boolean isJsapiTicketExpired();
|
||||
|
||||
/**
|
||||
* 强制将jsapi ticket过期掉
|
||||
*/
|
||||
public void expireJsapiTicket();
|
||||
void expireJsapiTicket();
|
||||
|
||||
/**
|
||||
* 应该是线程安全的
|
||||
* @param jsapiTicket
|
||||
*/
|
||||
public void updateJsapiTicket(String jsapiTicket, int expiresInSeconds);
|
||||
void updateJsapiTicket(String jsapiTicket, int expiresInSeconds);
|
||||
|
||||
public String getCorpId();
|
||||
String getCorpId();
|
||||
|
||||
public String getCorpSecret();
|
||||
String getCorpSecret();
|
||||
|
||||
public String getAgentId();
|
||||
String getAgentId();
|
||||
|
||||
public String getToken();
|
||||
String getToken();
|
||||
|
||||
public String getAesKey();
|
||||
String getAesKey();
|
||||
|
||||
public long getExpiresTime();
|
||||
long getExpiresTime();
|
||||
|
||||
public String getOauth2redirectUri();
|
||||
String getOauth2redirectUri();
|
||||
|
||||
public String getHttp_proxy_host();
|
||||
String getHttp_proxy_host();
|
||||
|
||||
public int getHttp_proxy_port();
|
||||
int getHttp_proxy_port();
|
||||
|
||||
public String getHttp_proxy_username();
|
||||
String getHttp_proxy_username();
|
||||
|
||||
public String getHttp_proxy_password();
|
||||
String getHttp_proxy_password();
|
||||
|
||||
public File getTmpDirFile();
|
||||
File getTmpDirFile();
|
||||
|
||||
/**
|
||||
* http client builder
|
||||
* @return ApacheHttpClientBuilder
|
||||
*/
|
||||
public ApacheHttpClientBuilder getApacheHttpClientBuilder();
|
||||
ApacheHttpClientBuilder getApacheHttpClientBuilder();
|
||||
}
|
||||
|
||||
@ -22,9 +22,9 @@ public interface WxCpMessageHandler {
|
||||
* @param sessionManager
|
||||
* @return xml格式的消息,如果在异步规则里处理的话,可以返回null
|
||||
*/
|
||||
public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage,
|
||||
Map<String, Object> context,
|
||||
WxCpService wxCpService,
|
||||
WxSessionManager sessionManager) throws WxErrorException;
|
||||
WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage,
|
||||
Map<String, Object> context,
|
||||
WxCpService wxCpService,
|
||||
WxSessionManager sessionManager) throws WxErrorException;
|
||||
|
||||
}
|
||||
|
||||
@ -22,9 +22,9 @@ public interface WxCpMessageInterceptor {
|
||||
* @param sessionManager
|
||||
* @return true代表OK,false代表不OK
|
||||
*/
|
||||
public boolean intercept(WxCpXmlMessage wxMessage,
|
||||
Map<String, Object> context,
|
||||
WxCpService wxCpService,
|
||||
WxSessionManager sessionManager) throws WxErrorException;
|
||||
boolean intercept(WxCpXmlMessage wxMessage,
|
||||
Map<String, Object> context,
|
||||
WxCpService wxCpService,
|
||||
WxSessionManager sessionManager) throws WxErrorException;
|
||||
|
||||
}
|
||||
|
||||
@ -10,6 +10,6 @@ public interface WxCpMessageMatcher {
|
||||
/**
|
||||
* 消息是否匹配某种模式
|
||||
*/
|
||||
public boolean match(WxCpXmlMessage message);
|
||||
boolean match(WxCpXmlMessage message);
|
||||
|
||||
}
|
||||
|
||||
@ -210,10 +210,7 @@ public class WxCpMessageRouter {
|
||||
messageId = String.valueOf(wxMessage.getMsgId());
|
||||
}
|
||||
|
||||
if (messageDuplicateChecker.isDuplicate(messageId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return messageDuplicateChecker.isDuplicate(messageId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ public interface WxCpService {
|
||||
* @see #getJsapiTicket(boolean)
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public String getJsapiTicket() throws WxErrorException;
|
||||
String getJsapiTicket() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@ -82,7 +82,7 @@ public interface WxCpService {
|
||||
* @param forceRefresh 强制刷新
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public String getJsapiTicket(boolean forceRefresh) throws WxErrorException;
|
||||
String getJsapiTicket(boolean forceRefresh) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
@ -92,7 +92,7 @@ public interface WxCpService {
|
||||
* </pre>
|
||||
* @param url url
|
||||
*/
|
||||
public WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;
|
||||
WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
||||
@ -49,7 +49,6 @@ public class WxCpMessageRouterTest {
|
||||
}
|
||||
}).handler(new WxEchoCpMessageHandler(sb, "matcher")).end()
|
||||
.rule().async(async).handler(new WxEchoCpMessageHandler(sb, "ALL")).end();
|
||||
;
|
||||
}
|
||||
|
||||
@Test(dataProvider="messages-1")
|
||||
|
||||
Reference in New Issue
Block a user