mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-06 21:57:48 +08:00
代码优化,由IDEA自动进行的Code Cleanup
This commit is contained in:
parent
622e185203
commit
3d6778f83a
@ -7,6 +7,6 @@ import me.chanjar.weixin.common.exception.WxErrorException;
|
|||||||
*/
|
*/
|
||||||
public interface WxErrorExceptionHandler {
|
public interface WxErrorExceptionHandler {
|
||||||
|
|
||||||
public void handle(WxErrorException e);
|
void handle(WxErrorException e);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,6 @@ public interface WxMessageDuplicateChecker {
|
|||||||
* @param messageId messageId需要根据上面讲的方式构造
|
* @param messageId messageId需要根据上面讲的方式构造
|
||||||
* @return 如果是重复消息,返回true,否则返回false
|
* @return 如果是重复消息,返回true,否则返回false
|
||||||
*/
|
*/
|
||||||
public boolean isDuplicate(String messageId);
|
boolean isDuplicate(String messageId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -87,11 +87,7 @@ public class WxMessageInMemoryDuplicateChecker implements WxMessageDuplicateChec
|
|||||||
}
|
}
|
||||||
checkBackgroundProcessStarted();
|
checkBackgroundProcessStarted();
|
||||||
Long timestamp = msgId2Timestamp.putIfAbsent(messageId, System.currentTimeMillis());
|
Long timestamp = msgId2Timestamp.putIfAbsent(messageId, System.currentTimeMillis());
|
||||||
if (timestamp == null) {
|
return timestamp != null;
|
||||||
// 第一次接收到这个消息
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ public interface InternalSession {
|
|||||||
*
|
*
|
||||||
* @param isValid The new value for the <code>isValid</code> flag
|
* @param isValid The new value for the <code>isValid</code> flag
|
||||||
*/
|
*/
|
||||||
public void setValid(boolean isValid);
|
void setValid(boolean isValid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the <code>isValid</code> flag for this session.
|
* Return the <code>isValid</code> flag for this session.
|
||||||
|
@ -28,14 +28,14 @@ public interface InternalSessionManager {
|
|||||||
* @exception IllegalStateException if a new session cannot be
|
* @exception IllegalStateException if a new session cannot be
|
||||||
* instantiated for any reason
|
* instantiated for any reason
|
||||||
*/
|
*/
|
||||||
public InternalSession createSession(String sessionId);
|
InternalSession createSession(String sessionId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove this Session from the active Sessions for this Manager.
|
* Remove this Session from the active Sessions for this Manager.
|
||||||
*
|
*
|
||||||
* @param session Session to be removed
|
* @param session Session to be removed
|
||||||
*/
|
*/
|
||||||
public void remove(InternalSession session);
|
void remove(InternalSession session);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove this Session from the active Sessions for this Manager.
|
* Remove this Session from the active Sessions for this Manager.
|
||||||
@ -43,7 +43,7 @@ public interface InternalSessionManager {
|
|||||||
* @param session Session to be removed
|
* @param session Session to be removed
|
||||||
* @param update Should the expiration statistics be updated
|
* @param update Should the expiration statistics be updated
|
||||||
*/
|
*/
|
||||||
public void remove(InternalSession session, boolean update);
|
void remove(InternalSession session, boolean update);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add this Session to the set of active Sessions for this Manager.
|
* Add this Session to the set of active Sessions for this Manager.
|
||||||
@ -71,7 +71,7 @@ public interface InternalSessionManager {
|
|||||||
/**
|
/**
|
||||||
* Implements the Manager interface, direct call to processExpires
|
* Implements the Manager interface, direct call to processExpires
|
||||||
*/
|
*/
|
||||||
public void backgroundProcess();
|
void backgroundProcess();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the default maximum inactive interval (in seconds)
|
* Set the default maximum inactive interval (in seconds)
|
||||||
|
@ -323,9 +323,8 @@ public class StandardSession implements WxSession, InternalSession {
|
|||||||
if (!attributes.equals(session.attributes)) return false;
|
if (!attributes.equals(session.attributes)) return false;
|
||||||
if (!facade.equals(session.facade)) return false;
|
if (!facade.equals(session.facade)) return false;
|
||||||
if (!id.equals(session.id)) return false;
|
if (!id.equals(session.id)) return false;
|
||||||
if (!manager.equals(session.manager)) return false;
|
return manager.equals(session.manager);
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -4,14 +4,14 @@ import java.util.Enumeration;
|
|||||||
|
|
||||||
public interface WxSession {
|
public interface WxSession {
|
||||||
|
|
||||||
public Object getAttribute(String name);
|
Object getAttribute(String name);
|
||||||
|
|
||||||
public Enumeration<String> getAttributeNames();
|
Enumeration<String> getAttributeNames();
|
||||||
|
|
||||||
public void setAttribute(String name, Object value);
|
void setAttribute(String name, Object value);
|
||||||
|
|
||||||
public void removeAttribute(String name);
|
void removeAttribute(String name);
|
||||||
|
|
||||||
public void invalidate();
|
void invalidate();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,12 @@ public interface WxSessionManager {
|
|||||||
/**
|
/**
|
||||||
* 获取某个sessionId对应的session,如果sessionId没有对应的session,则新建一个并返回。
|
* 获取某个sessionId对应的session,如果sessionId没有对应的session,则新建一个并返回。
|
||||||
*/
|
*/
|
||||||
public WxSession getSession(String sessionId);
|
WxSession getSession(String sessionId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取某个sessionId对应的session,如果sessionId没有对应的session,若create为true则新建一个,否则返回null。
|
* 获取某个sessionId对应的session,如果sessionId没有对应的session,若create为true则新建一个,否则返回null。
|
||||||
*/
|
*/
|
||||||
public WxSession getSession(String sessionId, boolean create);
|
WxSession getSession(String sessionId, boolean create);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ public class InputStreamResponseHandler implements ResponseHandler<InputStream>
|
|||||||
|
|
||||||
public static final ResponseHandler<InputStream> INSTANCE = new InputStreamResponseHandler();
|
public static final ResponseHandler<InputStream> INSTANCE = new InputStreamResponseHandler();
|
||||||
|
|
||||||
public InputStream handleResponse(final HttpResponse response) throws HttpResponseException, IOException {
|
public InputStream handleResponse(final HttpResponse response) throws IOException {
|
||||||
final StatusLine statusLine = response.getStatusLine();
|
final StatusLine statusLine = response.getStatusLine();
|
||||||
final HttpEntity entity = response.getEntity();
|
final HttpEntity entity = response.getEntity();
|
||||||
if (statusLine.getStatusCode() >= 300) {
|
if (statusLine.getStatusCode() >= 300) {
|
||||||
|
@ -39,7 +39,7 @@ public class MediaDownloadRequestExecutor implements RequestExecutor<File, Strin
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public File execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String queryParam) throws WxErrorException, ClientProtocolException, IOException {
|
public File execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String queryParam) throws WxErrorException, IOException {
|
||||||
if (queryParam != null) {
|
if (queryParam != null) {
|
||||||
if (uri.indexOf('?') == -1) {
|
if (uri.indexOf('?') == -1) {
|
||||||
uri += '?';
|
uri += '?';
|
||||||
|
@ -25,7 +25,7 @@ import java.io.IOException;
|
|||||||
public class MediaUploadRequestExecutor implements RequestExecutor<WxMediaUploadResult, File> {
|
public class MediaUploadRequestExecutor implements RequestExecutor<WxMediaUploadResult, File> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxMediaUploadResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, File file) throws WxErrorException, ClientProtocolException, IOException {
|
public WxMediaUploadResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, File file) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -26,6 +26,6 @@ public interface RequestExecutor<T, E> {
|
|||||||
* @throws ClientProtocolException
|
* @throws ClientProtocolException
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public T execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, E data) throws WxErrorException, ClientProtocolException, IOException;
|
T execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, E data) throws WxErrorException, IOException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import java.io.IOException;
|
|||||||
public class SimpleGetRequestExecutor implements RequestExecutor<String, String> {
|
public class SimpleGetRequestExecutor implements RequestExecutor<String, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String queryParam) throws WxErrorException, ClientProtocolException, IOException {
|
public String execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String queryParam) throws WxErrorException, IOException {
|
||||||
if (queryParam != null) {
|
if (queryParam != null) {
|
||||||
if (uri.indexOf('?') == -1) {
|
if (uri.indexOf('?') == -1) {
|
||||||
uri += '?';
|
uri += '?';
|
||||||
|
@ -21,7 +21,7 @@ import java.io.IOException;
|
|||||||
public class SimplePostRequestExecutor implements RequestExecutor<String, String> {
|
public class SimplePostRequestExecutor implements RequestExecutor<String, String> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String postEntity) throws WxErrorException, ClientProtocolException, IOException {
|
public String execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String postEntity) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -19,7 +19,7 @@ public class Utf8ResponseHandler implements ResponseHandler<String> {
|
|||||||
|
|
||||||
public static final ResponseHandler<String> INSTANCE = new Utf8ResponseHandler();
|
public static final ResponseHandler<String> INSTANCE = new Utf8ResponseHandler();
|
||||||
|
|
||||||
public String handleResponse(final HttpResponse response) throws HttpResponseException, IOException {
|
public String handleResponse(final HttpResponse response) throws IOException {
|
||||||
final StatusLine statusLine = response.getStatusLine();
|
final StatusLine statusLine = response.getStatusLine();
|
||||||
final HttpEntity entity = response.getEntity();
|
final HttpEntity entity = response.getEntity();
|
||||||
if (statusLine.getStatusCode() >= 300) {
|
if (statusLine.getStatusCode() >= 300) {
|
||||||
|
@ -91,7 +91,7 @@ public class GsonHelper {
|
|||||||
|
|
||||||
public static boolean getAsPrimitiveBool(JsonElement element) {
|
public static boolean getAsPrimitiveBool(JsonElement element) {
|
||||||
Boolean r = getAsBoolean(element);
|
Boolean r = getAsBoolean(element);
|
||||||
return r == null ? false : r.booleanValue();
|
return r != null && r.booleanValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Double getAsDouble(JsonElement element) {
|
public static Double getAsDouble(JsonElement element) {
|
||||||
|
@ -211,10 +211,7 @@ public class StringManager {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean removeEldestEntry(
|
protected boolean removeEldestEntry(
|
||||||
Map.Entry<Locale,StringManager> eldest) {
|
Map.Entry<Locale,StringManager> eldest) {
|
||||||
if (size() > (LOCALE_CACHE_SIZE - 1)) {
|
return size() > (LOCALE_CACHE_SIZE - 1);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
managers.put(packageName, map);
|
managers.put(packageName, map);
|
||||||
|
@ -12,61 +12,61 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public interface WxCpConfigStorage {
|
public interface WxCpConfigStorage {
|
||||||
|
|
||||||
public String getAccessToken();
|
String getAccessToken();
|
||||||
|
|
||||||
public boolean isAccessTokenExpired();
|
boolean isAccessTokenExpired();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强制将access token过期掉
|
* 强制将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过期掉
|
* 强制将jsapi ticket过期掉
|
||||||
*/
|
*/
|
||||||
public void expireJsapiTicket();
|
void expireJsapiTicket();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应该是线程安全的
|
* 应该是线程安全的
|
||||||
* @param jsapiTicket
|
* @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
|
* http client builder
|
||||||
* @return ApacheHttpClientBuilder
|
* @return ApacheHttpClientBuilder
|
||||||
*/
|
*/
|
||||||
public ApacheHttpClientBuilder getApacheHttpClientBuilder();
|
ApacheHttpClientBuilder getApacheHttpClientBuilder();
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public interface WxCpMessageHandler {
|
|||||||
* @param sessionManager
|
* @param sessionManager
|
||||||
* @return xml格式的消息,如果在异步规则里处理的话,可以返回null
|
* @return xml格式的消息,如果在异步规则里处理的话,可以返回null
|
||||||
*/
|
*/
|
||||||
public WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage,
|
WxCpXmlOutMessage handle(WxCpXmlMessage wxMessage,
|
||||||
Map<String, Object> context,
|
Map<String, Object> context,
|
||||||
WxCpService wxCpService,
|
WxCpService wxCpService,
|
||||||
WxSessionManager sessionManager) throws WxErrorException;
|
WxSessionManager sessionManager) throws WxErrorException;
|
||||||
|
@ -22,7 +22,7 @@ public interface WxCpMessageInterceptor {
|
|||||||
* @param sessionManager
|
* @param sessionManager
|
||||||
* @return true代表OK,false代表不OK
|
* @return true代表OK,false代表不OK
|
||||||
*/
|
*/
|
||||||
public boolean intercept(WxCpXmlMessage wxMessage,
|
boolean intercept(WxCpXmlMessage wxMessage,
|
||||||
Map<String, Object> context,
|
Map<String, Object> context,
|
||||||
WxCpService wxCpService,
|
WxCpService wxCpService,
|
||||||
WxSessionManager sessionManager) throws WxErrorException;
|
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());
|
messageId = String.valueOf(wxMessage.getMsgId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageDuplicateChecker.isDuplicate(messageId)) {
|
return messageDuplicateChecker.isDuplicate(messageId);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ public interface WxCpService {
|
|||||||
* @see #getJsapiTicket(boolean)
|
* @see #getJsapiTicket(boolean)
|
||||||
* @throws WxErrorException
|
* @throws WxErrorException
|
||||||
*/
|
*/
|
||||||
public String getJsapiTicket() throws WxErrorException;
|
String getJsapiTicket() throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -82,7 +82,7 @@ public interface WxCpService {
|
|||||||
* @param forceRefresh 强制刷新
|
* @param forceRefresh 强制刷新
|
||||||
* @throws WxErrorException
|
* @throws WxErrorException
|
||||||
*/
|
*/
|
||||||
public String getJsapiTicket(boolean forceRefresh) throws WxErrorException;
|
String getJsapiTicket(boolean forceRefresh) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -92,7 +92,7 @@ public interface WxCpService {
|
|||||||
* </pre>
|
* </pre>
|
||||||
* @param url url
|
* @param url url
|
||||||
*/
|
*/
|
||||||
public WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;
|
WxJsapiSignature createJsapiSignature(String url) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -49,7 +49,6 @@ public class WxCpMessageRouterTest {
|
|||||||
}
|
}
|
||||||
}).handler(new WxEchoCpMessageHandler(sb, "matcher")).end()
|
}).handler(new WxEchoCpMessageHandler(sb, "matcher")).end()
|
||||||
.rule().async(async).handler(new WxEchoCpMessageHandler(sb, "ALL")).end();
|
.rule().async(async).handler(new WxEchoCpMessageHandler(sb, "ALL")).end();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider="messages-1")
|
@Test(dataProvider="messages-1")
|
||||||
|
@ -13,89 +13,89 @@ import java.io.File;
|
|||||||
*/
|
*/
|
||||||
public interface WxMpConfigStorage {
|
public interface WxMpConfigStorage {
|
||||||
|
|
||||||
public String getAccessToken();
|
String getAccessToken();
|
||||||
|
|
||||||
public boolean isAccessTokenExpired();
|
boolean isAccessTokenExpired();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强制将access token过期掉
|
* 强制将access token过期掉
|
||||||
*/
|
*/
|
||||||
public void expireAccessToken();
|
void expireAccessToken();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应该是线程安全的
|
* 应该是线程安全的
|
||||||
* @param accessToken
|
* @param accessToken
|
||||||
*/
|
*/
|
||||||
public void updateAccessToken(WxAccessToken accessToken);
|
void updateAccessToken(WxAccessToken accessToken);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应该是线程安全的
|
* 应该是线程安全的
|
||||||
* @param accessToken
|
* @param accessToken
|
||||||
* @param expiresIn
|
* @param expiresIn
|
||||||
*/
|
*/
|
||||||
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过期掉
|
* 强制将jsapi ticket过期掉
|
||||||
*/
|
*/
|
||||||
public void expireJsapiTicket();
|
void expireJsapiTicket();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应该是线程安全的
|
* 应该是线程安全的
|
||||||
* @param jsapiTicket
|
* @param jsapiTicket
|
||||||
*/
|
*/
|
||||||
public void updateJsapiTicket(String jsapiTicket, int expiresInSeconds);
|
void updateJsapiTicket(String jsapiTicket, int expiresInSeconds);
|
||||||
|
|
||||||
public String getCardApiTicket();
|
String getCardApiTicket();
|
||||||
|
|
||||||
public boolean isCardApiTicketExpired();
|
boolean isCardApiTicketExpired();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 强制将卡券api ticket过期掉
|
* 强制将卡券api ticket过期掉
|
||||||
*/
|
*/
|
||||||
public void expireCardApiTicket();
|
void expireCardApiTicket();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 应该是线程安全的
|
* 应该是线程安全的
|
||||||
* @param cardApiTicket
|
* @param cardApiTicket
|
||||||
*/
|
*/
|
||||||
public void updateCardApiTicket(String cardApiTicket, int expiresInSeconds);
|
void updateCardApiTicket(String cardApiTicket, int expiresInSeconds);
|
||||||
|
|
||||||
public String getAppId();
|
String getAppId();
|
||||||
|
|
||||||
public String getSecret();
|
String getSecret();
|
||||||
|
|
||||||
public String getPartnerId();
|
String getPartnerId();
|
||||||
|
|
||||||
public String getPartnerKey();
|
String getPartnerKey();
|
||||||
|
|
||||||
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();
|
||||||
|
|
||||||
public SSLContext getSSLContext();
|
SSLContext getSSLContext();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http client builder
|
* http client builder
|
||||||
* @return ApacheHttpClientBuilder
|
* @return ApacheHttpClientBuilder
|
||||||
*/
|
*/
|
||||||
public ApacheHttpClientBuilder getApacheHttpClientBuilder();
|
ApacheHttpClientBuilder getApacheHttpClientBuilder();
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ public interface WxMpGroupService {
|
|||||||
*
|
*
|
||||||
* @param name 分组名字(30个字符以内)
|
* @param name 分组名字(30个字符以内)
|
||||||
*/
|
*/
|
||||||
public WxMpGroup groupCreate(String name) throws WxErrorException;
|
WxMpGroup groupCreate(String name) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -30,7 +30,7 @@ public interface WxMpGroupService {
|
|||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=分组管理接口
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public List<WxMpGroup> groupGet() throws WxErrorException;
|
List<WxMpGroup> groupGet() throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -40,7 +40,7 @@ public interface WxMpGroupService {
|
|||||||
*
|
*
|
||||||
* @param openid 微信用户的openid
|
* @param openid 微信用户的openid
|
||||||
*/
|
*/
|
||||||
public long userGetGroup(String openid) throws WxErrorException;
|
long userGetGroup(String openid) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -52,7 +52,7 @@ public interface WxMpGroupService {
|
|||||||
*
|
*
|
||||||
* @param group 要更新的group,group的id,name必须设置
|
* @param group 要更新的group,group的id,name必须设置
|
||||||
*/
|
*/
|
||||||
public void groupUpdate(WxMpGroup group) throws WxErrorException;
|
void groupUpdate(WxMpGroup group) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -65,5 +65,5 @@ public interface WxMpGroupService {
|
|||||||
* @param openid 用户openid
|
* @param openid 用户openid
|
||||||
* @param to_groupid 移动到的分组id
|
* @param to_groupid 移动到的分组id
|
||||||
*/
|
*/
|
||||||
public void userUpdateGroup(String openid, long to_groupid) throws WxErrorException;
|
void userUpdateGroup(String openid, long to_groupid) throws WxErrorException;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public interface WxMpMaterialService {
|
|||||||
* @throws WxErrorException
|
* @throws WxErrorException
|
||||||
* @see #mediaUpload(String, String, InputStream)
|
* @see #mediaUpload(String, String, InputStream)
|
||||||
*/
|
*/
|
||||||
public WxMediaUploadResult mediaUpload(String mediaType, File file) throws WxErrorException;
|
WxMediaUploadResult mediaUpload(String mediaType, File file) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -39,7 +39,7 @@ public interface WxMpMaterialService {
|
|||||||
* @return 保存到本地的临时文件
|
* @return 保存到本地的临时文件
|
||||||
* @throws WxErrorException
|
* @throws WxErrorException
|
||||||
*/
|
*/
|
||||||
public File mediaDownload(String media_id) throws WxErrorException;
|
File mediaDownload(String media_id) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -51,7 +51,7 @@ public interface WxMpMaterialService {
|
|||||||
* @return WxMediaImgUploadResult 返回图片url
|
* @return WxMediaImgUploadResult 返回图片url
|
||||||
* @throws WxErrorException
|
* @throws WxErrorException
|
||||||
*/
|
*/
|
||||||
public WxMediaImgUploadResult mediaImgUpload(File file) throws WxErrorException;
|
WxMediaImgUploadResult mediaImgUpload(File file) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -72,7 +72,7 @@ public interface WxMpMaterialService {
|
|||||||
* @param inputStream 输入流
|
* @param inputStream 输入流
|
||||||
* @throws WxErrorException
|
* @throws WxErrorException
|
||||||
*/
|
*/
|
||||||
public WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream) throws WxErrorException, IOException;
|
WxMediaUploadResult mediaUpload(String mediaType, String fileType, InputStream inputStream) throws WxErrorException, IOException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -90,7 +90,7 @@ public interface WxMpMaterialService {
|
|||||||
* @param mediaType 媒体类型, 请看{@link me.chanjar.weixin.common.api.WxConsts}
|
* @param mediaType 媒体类型, 请看{@link me.chanjar.weixin.common.api.WxConsts}
|
||||||
* @param material 上传的素材, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterial}
|
* @param material 上传的素材, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterial}
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialUploadResult materialFileUpload(String mediaType, WxMpMaterial material) throws WxErrorException;
|
WxMpMaterialUploadResult materialFileUpload(String mediaType, WxMpMaterial material) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -101,7 +101,7 @@ public interface WxMpMaterialService {
|
|||||||
*
|
*
|
||||||
* @param news 上传的图文消息, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterialNews}
|
* @param news 上传的图文消息, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterialNews}
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialUploadResult materialNewsUpload(WxMpMaterialNews news) throws WxErrorException;
|
WxMpMaterialUploadResult materialNewsUpload(WxMpMaterialNews news) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -112,7 +112,7 @@ public interface WxMpMaterialService {
|
|||||||
*
|
*
|
||||||
* @param media_id 永久素材的id
|
* @param media_id 永久素材的id
|
||||||
*/
|
*/
|
||||||
public InputStream materialImageOrVoiceDownload(String media_id) throws WxErrorException;
|
InputStream materialImageOrVoiceDownload(String media_id) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -123,7 +123,7 @@ public interface WxMpMaterialService {
|
|||||||
*
|
*
|
||||||
* @param media_id 永久素材的id
|
* @param media_id 永久素材的id
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialVideoInfoResult materialVideoInfo(String media_id) throws WxErrorException;
|
WxMpMaterialVideoInfoResult materialVideoInfo(String media_id) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -134,7 +134,7 @@ public interface WxMpMaterialService {
|
|||||||
*
|
*
|
||||||
* @param media_id 永久素材的id
|
* @param media_id 永久素材的id
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialNews materialNewsInfo(String media_id) throws WxErrorException;
|
WxMpMaterialNews materialNewsInfo(String media_id) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -145,7 +145,7 @@ public interface WxMpMaterialService {
|
|||||||
*
|
*
|
||||||
* @param wxMpMaterialArticleUpdate 用来更新图文素材的bean, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterialArticleUpdate}
|
* @param wxMpMaterialArticleUpdate 用来更新图文素材的bean, 请看{@link me.chanjar.weixin.mp.bean.WxMpMaterialArticleUpdate}
|
||||||
*/
|
*/
|
||||||
public boolean materialNewsUpdate(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate) throws WxErrorException;
|
boolean materialNewsUpdate(WxMpMaterialArticleUpdate wxMpMaterialArticleUpdate) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -156,7 +156,7 @@ public interface WxMpMaterialService {
|
|||||||
*
|
*
|
||||||
* @param media_id 永久素材的id
|
* @param media_id 永久素材的id
|
||||||
*/
|
*/
|
||||||
public boolean materialDelete(String media_id) throws WxErrorException;
|
boolean materialDelete(String media_id) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -165,7 +165,7 @@ public interface WxMpMaterialService {
|
|||||||
* 详情请见: http://mp.weixin.qq.com/wiki/16/8cc64f8c189674b421bee3ed403993b8.html
|
* 详情请见: http://mp.weixin.qq.com/wiki/16/8cc64f8c189674b421bee3ed403993b8.html
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialCountResult materialCount() throws WxErrorException;
|
WxMpMaterialCountResult materialCount() throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -177,7 +177,7 @@ public interface WxMpMaterialService {
|
|||||||
* @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
|
* @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
|
||||||
* @param count 返回素材的数量,取值在1到20之间
|
* @param count 返回素材的数量,取值在1到20之间
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialNewsBatchGetResult materialNewsBatchGet(int offset, int count) throws WxErrorException;
|
WxMpMaterialNewsBatchGetResult materialNewsBatchGet(int offset, int count) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -190,6 +190,6 @@ public interface WxMpMaterialService {
|
|||||||
* @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
|
* @param offset 从全部素材的该偏移位置开始返回,0表示从第一个素材 返回
|
||||||
* @param count 返回素材的数量,取值在1到20之间
|
* @param count 返回素材的数量,取值在1到20之间
|
||||||
*/
|
*/
|
||||||
public WxMpMaterialFileBatchGetResult materialFileBatchGet(String type, int offset, int count) throws WxErrorException;
|
WxMpMaterialFileBatchGetResult materialFileBatchGet(String type, int offset, int count) throws WxErrorException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ public interface WxMpMenuService {
|
|||||||
* 详情请见:http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
|
* 详情请见:http://mp.weixin.qq.com/wiki/0/c48ccd12b69ae023159b4bfaa7c39c20.html
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public void menuCreate(WxMenu menu) throws WxErrorException;
|
void menuCreate(WxMenu menu) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -26,7 +26,7 @@ public interface WxMpMenuService {
|
|||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单删除接口
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单删除接口
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public void menuDelete() throws WxErrorException;
|
void menuDelete() throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -36,7 +36,7 @@ public interface WxMpMenuService {
|
|||||||
*
|
*
|
||||||
* @param menuid
|
* @param menuid
|
||||||
*/
|
*/
|
||||||
public void menuDelete(String menuid) throws WxErrorException;
|
void menuDelete(String menuid) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -44,7 +44,7 @@ public interface WxMpMenuService {
|
|||||||
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单查询接口
|
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=自定义菜单查询接口
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public WxMenu menuGet() throws WxErrorException;
|
WxMenu menuGet() throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -54,6 +54,6 @@ public interface WxMpMenuService {
|
|||||||
*
|
*
|
||||||
* @param userid 可以是粉丝的OpenID,也可以是粉丝的微信号。
|
* @param userid 可以是粉丝的OpenID,也可以是粉丝的微信号。
|
||||||
*/
|
*/
|
||||||
public WxMenu menuTryMatch(String userid) throws WxErrorException;
|
WxMenu menuTryMatch(String userid) throws WxErrorException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public interface WxMpMessageHandler {
|
|||||||
* @param sessionManager
|
* @param sessionManager
|
||||||
* @return xml格式的消息,如果在异步规则里处理的话,可以返回null
|
* @return xml格式的消息,如果在异步规则里处理的话,可以返回null
|
||||||
*/
|
*/
|
||||||
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
|
WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
|
||||||
Map<String, Object> context,
|
Map<String, Object> context,
|
||||||
WxMpService wxMpService,
|
WxMpService wxMpService,
|
||||||
WxSessionManager sessionManager) throws WxErrorException;
|
WxSessionManager sessionManager) throws WxErrorException;
|
||||||
|
@ -22,7 +22,7 @@ public interface WxMpMessageInterceptor {
|
|||||||
* @param sessionManager
|
* @param sessionManager
|
||||||
* @return true代表OK,false代表不OK
|
* @return true代表OK,false代表不OK
|
||||||
*/
|
*/
|
||||||
public boolean intercept(WxMpXmlMessage wxMessage,
|
boolean intercept(WxMpXmlMessage wxMessage,
|
||||||
Map<String, Object> context,
|
Map<String, Object> context,
|
||||||
WxMpService wxMpService,
|
WxMpService wxMpService,
|
||||||
WxSessionManager sessionManager) throws WxErrorException;
|
WxSessionManager sessionManager) throws WxErrorException;
|
||||||
|
@ -11,6 +11,6 @@ public interface WxMpMessageMatcher {
|
|||||||
* 消息是否匹配某种模式
|
* 消息是否匹配某种模式
|
||||||
* @param message
|
* @param message
|
||||||
*/
|
*/
|
||||||
public boolean match(WxMpXmlMessage message);
|
boolean match(WxMpXmlMessage message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -209,10 +209,7 @@ public class WxMpMessageRouter {
|
|||||||
messageId.append(wxMessage.getMsgId());
|
messageId.append(wxMessage.getMsgId());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (messageDuplicateChecker.isDuplicate(messageId.toString())) {
|
return messageDuplicateChecker.isDuplicate(messageId.toString());
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ public interface WxMpQrcodeService {
|
|||||||
* @param scene_id 参数。
|
* @param scene_id 参数。
|
||||||
* @param expire_seconds 过期秒数,默认60秒,最小60秒,最大1800秒
|
* @param expire_seconds 过期秒数,默认60秒,最小60秒,最大1800秒
|
||||||
*/
|
*/
|
||||||
public WxMpQrCodeTicket qrCodeCreateTmpTicket(int scene_id, Integer expire_seconds) throws WxErrorException;
|
WxMpQrCodeTicket qrCodeCreateTmpTicket(int scene_id, Integer expire_seconds) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -31,7 +31,7 @@ public interface WxMpQrcodeService {
|
|||||||
*
|
*
|
||||||
* @param scene_id 参数。永久二维码时最大值为100000(目前参数只支持1--100000)
|
* @param scene_id 参数。永久二维码时最大值为100000(目前参数只支持1--100000)
|
||||||
*/
|
*/
|
||||||
public WxMpQrCodeTicket qrCodeCreateLastTicket(int scene_id) throws WxErrorException;
|
WxMpQrCodeTicket qrCodeCreateLastTicket(int scene_id) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -41,7 +41,7 @@ public interface WxMpQrcodeService {
|
|||||||
*
|
*
|
||||||
* @param scene_str 参数。字符串类型长度现在为1到64
|
* @param scene_str 参数。字符串类型长度现在为1到64
|
||||||
*/
|
*/
|
||||||
public WxMpQrCodeTicket qrCodeCreateLastTicket(String scene_str) throws WxErrorException;
|
WxMpQrCodeTicket qrCodeCreateLastTicket(String scene_str) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -51,7 +51,7 @@ public interface WxMpQrcodeService {
|
|||||||
*
|
*
|
||||||
* @param ticket 二维码ticket
|
* @param ticket 二维码ticket
|
||||||
*/
|
*/
|
||||||
public File qrCodePicture(WxMpQrCodeTicket ticket) throws WxErrorException;
|
File qrCodePicture(WxMpQrCodeTicket ticket) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -62,7 +62,7 @@ public interface WxMpQrcodeService {
|
|||||||
* @param ticket 二维码ticket
|
* @param ticket 二维码ticket
|
||||||
* @param needShortUrl 是否需要压缩的二维码地址
|
* @param needShortUrl 是否需要压缩的二维码地址
|
||||||
*/
|
*/
|
||||||
public String qrCodePictureUrl(String ticket, boolean needShortUrl) throws WxErrorException;
|
String qrCodePictureUrl(String ticket, boolean needShortUrl) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -72,6 +72,6 @@ public interface WxMpQrcodeService {
|
|||||||
*
|
*
|
||||||
* @param ticket 二维码ticket
|
* @param ticket 二维码ticket
|
||||||
*/
|
*/
|
||||||
public String qrCodePictureUrl(String ticket) throws WxErrorException;
|
String qrCodePictureUrl(String ticket) throws WxErrorException;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public interface WxMpUserService {
|
|||||||
* @param openid 用户openid
|
* @param openid 用户openid
|
||||||
* @param remark 备注名
|
* @param remark 备注名
|
||||||
*/
|
*/
|
||||||
public void userUpdateRemark(String openid, String remark) throws WxErrorException;
|
void userUpdateRemark(String openid, String remark) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -36,7 +36,7 @@ public interface WxMpUserService {
|
|||||||
* @param openid 用户openid
|
* @param openid 用户openid
|
||||||
* @param lang 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语
|
* @param lang 语言,zh_CN 简体(默认),zh_TW 繁体,en 英语
|
||||||
*/
|
*/
|
||||||
public WxMpUser userInfo(String openid, String lang) throws WxErrorException;
|
WxMpUser userInfo(String openid, String lang) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
@ -46,7 +46,7 @@ public interface WxMpUserService {
|
|||||||
*
|
*
|
||||||
* @param next_openid 可选,第一个拉取的OPENID,null为从头开始拉取
|
* @param next_openid 可选,第一个拉取的OPENID,null为从头开始拉取
|
||||||
*/
|
*/
|
||||||
public WxMpUserList userList(String next_openid) throws WxErrorException;
|
WxMpUserList userList(String next_openid) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -24,7 +24,7 @@ public class MaterialDeleteRequestExecutor implements RequestExecutor<Boolean, S
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, ClientProtocolException, IOException {
|
public Boolean execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -25,7 +25,7 @@ public class MaterialNewsInfoRequestExecutor implements RequestExecutor<WxMpMate
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public WxMpMaterialNews execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, ClientProtocolException, IOException {
|
public WxMpMaterialNews execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -23,7 +23,7 @@ import java.util.Map;
|
|||||||
public class MaterialUploadRequestExecutor implements RequestExecutor<WxMpMaterialUploadResult, WxMpMaterial> {
|
public class MaterialUploadRequestExecutor implements RequestExecutor<WxMpMaterialUploadResult, WxMpMaterial> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WxMpMaterialUploadResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, WxMpMaterial material) throws WxErrorException, ClientProtocolException, IOException {
|
public WxMpMaterialUploadResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, WxMpMaterial material) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig response = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig response = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -24,7 +24,7 @@ public class MaterialVideoInfoRequestExecutor implements RequestExecutor<WxMpMat
|
|||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public WxMpMaterialVideoInfoResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, ClientProtocolException, IOException {
|
public WxMpMaterialVideoInfoResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -34,7 +34,7 @@ public class MaterialVoiceAndImageDownloadRequestExecutor implements RequestExec
|
|||||||
this.tmpDirFile = tmpDirFile;
|
this.tmpDirFile = tmpDirFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InputStream execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, ClientProtocolException, IOException {
|
public InputStream execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, String materialId) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -24,7 +24,7 @@ import java.io.IOException;
|
|||||||
*/
|
*/
|
||||||
public class MediaImgUploadRequestExecutor implements RequestExecutor<WxMediaImgUploadResult, File> {
|
public class MediaImgUploadRequestExecutor implements RequestExecutor<WxMediaImgUploadResult, File> {
|
||||||
@Override
|
@Override
|
||||||
public WxMediaImgUploadResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, File data) throws WxErrorException, ClientProtocolException, IOException {
|
public WxMediaImgUploadResult execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri, File data) throws WxErrorException, IOException {
|
||||||
HttpPost httpPost = new HttpPost(uri);
|
HttpPost httpPost = new HttpPost(uri);
|
||||||
if (httpProxy != null) {
|
if (httpProxy != null) {
|
||||||
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
RequestConfig config = RequestConfig.custom().setProxy(httpProxy).build();
|
||||||
|
@ -31,7 +31,7 @@ public class QrCodeRequestExecutor implements RequestExecutor<File, WxMpQrCodeTi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public File execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri,
|
public File execute(CloseableHttpClient httpclient, HttpHost httpProxy, String uri,
|
||||||
WxMpQrCodeTicket ticket) throws WxErrorException, ClientProtocolException, IOException {
|
WxMpQrCodeTicket ticket) throws WxErrorException, IOException {
|
||||||
if (ticket != null) {
|
if (ticket != null) {
|
||||||
if (uri.indexOf('?') == -1) {
|
if (uri.indexOf('?') == -1) {
|
||||||
uri += '?';
|
uri += '?';
|
||||||
|
@ -18,7 +18,7 @@ public class WxLongTimeJsonSerializer extends JsonSerializer<Long> {
|
|||||||
@Override
|
@Override
|
||||||
public void serialize(Long value, JsonGenerator gen,
|
public void serialize(Long value, JsonGenerator gen,
|
||||||
SerializerProvider serializers)
|
SerializerProvider serializers)
|
||||||
throws IOException, JsonProcessingException {
|
throws IOException {
|
||||||
gen.writeString(DF.format(value * 1000));
|
gen.writeString(DF.format(value * 1000));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class WxMpUserGsonAdapter implements JsonDeserializer<WxMpUser> {
|
|||||||
WxMpUser wxMpUser = new WxMpUser();
|
WxMpUser wxMpUser = new WxMpUser();
|
||||||
Integer subscribe = GsonHelper.getInteger(o, "subscribe");
|
Integer subscribe = GsonHelper.getInteger(o, "subscribe");
|
||||||
if (subscribe != null) {
|
if (subscribe != null) {
|
||||||
wxMpUser.setSubscribe(new Integer(0).equals(subscribe) ? false : true);
|
wxMpUser.setSubscribe(!new Integer(0).equals(subscribe));
|
||||||
}
|
}
|
||||||
wxMpUser.setCity(GsonHelper.getString(o, "city"));
|
wxMpUser.setCity(GsonHelper.getString(o, "city"));
|
||||||
wxMpUser.setCountry(GsonHelper.getString(o, "country"));
|
wxMpUser.setCountry(GsonHelper.getString(o, "country"));
|
||||||
|
@ -49,7 +49,6 @@ public class WxMpMessageRouterTest {
|
|||||||
}
|
}
|
||||||
}).handler(new WxEchoMpMessageHandler(sb, "matcher")).end()
|
}).handler(new WxEchoMpMessageHandler(sb, "matcher")).end()
|
||||||
.rule().async(async).handler(new WxEchoMpMessageHandler(sb, "ALL")).end();
|
.rule().async(async).handler(new WxEchoMpMessageHandler(sb, "ALL")).end();
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test(dataProvider="messages-1")
|
@Test(dataProvider="messages-1")
|
||||||
|
Loading…
Reference in New Issue
Block a user