This commit is contained in:
Van0313
2025-06-25 00:46:02 +08:00
parent 96e053dd48
commit c0a86f6a6f

View File

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