录单
This commit is contained in:
@@ -1947,18 +1947,20 @@ public class JDUtil {
|
|||||||
commentToUse = availableComments.get(0);
|
commentToUse = availableComments.get(0);
|
||||||
}
|
}
|
||||||
} else if (response.getStatus() == -200) {
|
} else if (response.getStatus() == -200) {
|
||||||
wxUtil.sendTextMessage(fromWxid, "暂时无法获取新的评论,请稍后再试", 1, fromWxid, false);
|
wxUtil.sendTextMessage(fromWxid, "请求响应:暂无新的评论。为您随机选取使用过的评论", 1, fromWxid, false);
|
||||||
return;
|
// 随机选取一个使用过的评论
|
||||||
|
Collections.shuffle(usedComments);
|
||||||
|
commentToUse = usedComments.get(0);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("调用外部接口获取评论失败", e);
|
logger.error("调用外部接口获取评论失败", e);
|
||||||
wxUtil.sendTextMessage(fromWxid, "调用外部接口获取评论失败", 1, fromWxid, false);
|
wxUtil.sendTextMessage(fromWxid, "请求响应:响应超时。为您随机选取使用过的评论", 1, fromWxid, false);
|
||||||
return;
|
commentToUse = usedComments.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commentToUse == null) {
|
if (commentToUse == null) {
|
||||||
wxUtil.sendTextMessage(fromWxid, "没有找到可用的评论数据", 1, fromWxid, false);
|
wxUtil.sendTextMessage(fromWxid, "本地和京东均无可用的评论数据,请检查sku", 1, fromWxid, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
wxUtil.sendTextMessage(fromWxid, commentToUse.getCommentText(), 1, fromWxid, true);
|
wxUtil.sendTextMessage(fromWxid, commentToUse.getCommentText(), 1, fromWxid, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user