自动抓评论

This commit is contained in:
Van0313
2025-06-01 17:11:14 +08:00
parent f4d72b4335
commit 24c196c8a3
2 changed files with 116 additions and 8 deletions

View File

@@ -1771,7 +1771,7 @@ public class JDUtil {
}
//getProductTypeMap 从redis中获取PRODUCT_TYPE_MAP_PREFIX
public void getProductTypeMap() {
public HashMap<String, String> getProductTypeMap() {
Map<Object, Object> rawMap = redisTemplate.opsForHash().entries(PRODUCT_TYPE_MAP_PREFIX);
if (!rawMap.isEmpty()) {
@@ -1781,9 +1781,11 @@ public class JDUtil {
}
// 排序
productTypeMap = productTypeMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new));
return productTypeMap;
} else {
logger.warn("Redis 中未找到键为 {} 的 Hash 数据", PRODUCT_TYPE_MAP_PREFIX);
}
return null;
}
public void addProductTypeMap(String key, String value) {
@@ -1819,6 +1821,7 @@ public class JDUtil {
* 生成评论内容
*/
private synchronized void generateComment(String fromWxid, String productType) {
//wxUtil.sendTextMessage(fromWxid, "已接收到评论生成指令,等候过程请勿重复输入", 1, fromWxid, true);
int allCommentCount = 0;
int usedCommentCount = 0;