基本完成转链。富贵指日可待!

This commit is contained in:
Leo
2025-04-05 02:01:22 +08:00
parent e1df955d07
commit c81d0224c8

View File

@@ -822,26 +822,12 @@ public class JDUtil {
for (String text : contentResult.get("text")) {
wxUtil.sendTextMessage(wxid, text, 1, wxid);
}
// 5. 缓存商品数据
if (!contentResult.get("data").isEmpty()) {
String productData = contentResult.get("data").get(0);
cacheMap.put("productData" + wxid, productData);
cacheMap.put("finalWenAn" + wxid, contentResult.get("finalWenAn").get(0));
// 6. 进入确认礼金步骤
state.setCurrentField("confirm");
wxUtil.sendTextMessage(wxid,
"是否需要开通礼金?\n回复 1 - 是\n回复 2 - 否",
1, wxid);
} else {
wxUtil.sendTextMessage(wxid, "未获取到商品数据,请检查链接格式", 1, wxid);
state.reset();
}
// 4. 发送图片(如果有)
List<String> images = contentResult.get("images");
if (images != null) {
try {
Thread.sleep(5000);
Thread.sleep(6000);
} catch (InterruptedException ignored) {
}
@@ -852,7 +838,26 @@ public class JDUtil {
}
}
// 5. 缓存商品数据
if (!contentResult.get("data").isEmpty()) {
String productData = contentResult.get("data").get(0);
cacheMap.put("productData" + wxid, productData);
cacheMap.put("finalWenAn" + wxid, contentResult.get("finalWenAn").get(0));
// 6. 进入确认礼金步骤
state.setCurrentField("confirm");
try {
Thread.sleep(5000);
}catch (InterruptedException ignored){
}
wxUtil.sendTextMessage(wxid,
"是否需要开通礼金?\n回复 1 - 是\n回复 2 - 否",
1, wxid);
} else {
wxUtil.sendTextMessage(wxid, "未获取到商品数据,请检查链接格式", 1, wxid);
state.reset();
}
} catch (Exception e) {
logger.error("处理推广内容异常 - 用户: {}", wxid, e);
wxUtil.sendTextMessage(wxid, "处理内容时发生异常,请重试", 1, wxid);