This commit is contained in:
Van0313
2025-07-05 22:45:29 +08:00
parent dbf4b34072
commit b86b7e44dc

View File

@@ -1992,19 +1992,25 @@ public class JDUtil {
}
}
gptResponse = gptClientUtil.getGPTResponse(deepSeekPrompt.toString());
logger.info("gptResponse: {}", gptResponse);
} catch (Exception e) {
logger.error("生成评论异常 - 用户: {}", fromWxid, e);
wxUtil.sendTextMessage(fromWxid, "AI 评论生成失败", 1, fromWxid, false);
}
// 发送生成的评论文本
if (Util.isNotEmpty(gptResponse)) {
String[] split = gptResponse.split("\n");
for (String s : split) {
s = s.replaceAll("1.|2.", "");
wxUtil.sendTextMessage(fromWxid, s, 1, fromWxid, true);
if (gptResponse != null && !gptResponse.isEmpty()) {
try {
String[] split = gptResponse.split("\n");
for (String s : split) {
s = s.replaceAll("1.|2.", "");
wxUtil.sendTextMessage(fromWxid, s, 1, fromWxid, true);
}
} catch (Exception ignored) {
} finally {
wxUtil.sendTextMessage(fromWxid, gptResponse, 1, fromWxid, true);
}
}
//wxUtil.sendTextMessage(fromWxid, gptResponse, 1, fromWxid, true);
wxUtil.sendTextMessage(fromWxid, "评论统计:\n" + "型号 " + productType + "\n" + "新增:" + addCommentCount + "\n" + "已使用:" + usedCommentCount + "\n" + "可用:" + canUseComentCount + "\n" + "总数:" + allCommentCount, 1, fromWxid, true);
// 更新评论状态为已使用
commentToUse.setIsUse(1);