Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Commit

Permalink
升级java-toolkit > 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Acexy committed Sep 10, 2018
1 parent 188b14a commit b558204
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<fast-toolkit.version>1.0.6</fast-toolkit.version>
<fast-toolkit.version>1.0.9</fast-toolkit.version>
<httpasyncclient.version>4.1.3</httpasyncclient.version>
<fastjson.version>1.2.47</fastjson.version>
<org.slf4j.version>1.7.25</org.slf4j.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private boolean doExceptionCheck(PullMsgStatus pullMsgStatus) {
// 重置监控数据
session.resetMonitoringData();
try {
Method method = ReflectHelper.getMethod(loginAction, "beginLogin");
Method method = ReflectHelper.getMethod(LoginAction.class, "beginLogin");
int retryTimes = ConfigParams.AUTO_RE_LOGIN_RETRY_MAX_TIME;
while (retryTimes > 0) {
boolean flag = (boolean) ReflectHelper.invokeMethod(loginAction, method);
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/thankjava/wqq/core/request/aop/DoRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
public class DoRequest {

private static final String proxyMethodName = "buildRequestParams";

private static Logger logger = LoggerFactory.getLogger(DoRequest.class);

private static AsyncHttpClient asyncHttpClient = BaseHttpService.asyncHttpClient;
Expand All @@ -32,28 +32,28 @@ public AopParam doRequest(AopParam aopParam) {
// 执行buildRequestParams 得到请求的参数体
Object proxyInstance = aopParam.getProxyInstance();

Method method = ReflectHelper.getMethod(proxyInstance, proxyMethodName);
Method method = ReflectHelper.getMethod(proxyInstance.getClass(), proxyMethodName);
AsyncRequest asyncRequest = (AsyncRequest) ReflectHelper.invokeMethod(proxyInstance, method);

if (listener != null) {
// 如果传递了listener 则通过listener的方式回调返回
try {
listener.onListener(new ActionListener((asyncHttpClient.syncRequestWithSession(asyncRequest))));
} catch (Throwable e) {
logger.error("http request error", e);
logger.error("http request error", e);
listener.onListener(new ActionListener());
}

} else {

try {
try {
aopParam.setResult(asyncHttpClient.syncRequestWithSession(asyncRequest));
}catch (Throwable e) {
aopParam.setResult(null);
logger.error("http request error", e);
}
} catch (Throwable e) {
aopParam.setResult(null);
logger.error("http request error", e);
}
}

// 通过普通的方式返回结果
return aopParam;
}
Expand Down

0 comments on commit b558204

Please sign in to comment.