This commit is contained in:
2025-10-30 21:52:19 +08:00
parent aaa157ebc0
commit 20ca62ffd3

View File

@@ -90,23 +90,84 @@ public class BatchPublishServiceImpl implements IBatchPublishService
return cleaned;
}
/**
* 清理敏感营销词(保留换行不动)
*/
private String cleanForbiddenPhrases(String text) {
if (text == null || text.isEmpty()) {
return text;
}
String cleaned = text;
// 先清理更长的组合词,再清理单词
cleaned = cleaned.replaceAll("咨询客服领\\s*国补", "");
cleaned = cleaned.replaceAll("政府补贴", "");
cleaned = cleaned.replaceAll("国补", "");
cleaned = cleaned.replaceAll("补贴", "");
// 清理每行首尾空格
cleaned = cleaned.replaceAll("(?m)^[ \\t]+|[ \\t]+$", "");
return cleaned;
/**
* 清理敏感营销词(保留换行不动)
*/
private String cleanForbiddenPhrases(String text) {
if (text == null || text.isEmpty()) {
return text;
}
String cleaned = text;
// 一、政策补贴及特殊渠道类(长组合优先)
cleaned = cleaned.replaceAll("咨询客服领\\s*国补", "");
cleaned = cleaned.replaceAll("政府\\s*补贴", ""); // 匹配"政府 补贴"等带空格的情况
cleaned = cleaned.replaceAll("购车\\s*补贴", "");
cleaned = cleaned.replaceAll("家电\\s*下乡", "");
cleaned = cleaned.replaceAll("内部\\s*渠道", "");
cleaned = cleaned.replaceAll("特殊\\s*通道", "");
cleaned = cleaned.replaceAll("免税\\s*配额", "");
cleaned = cleaned.replaceAll("国补", "");
cleaned = cleaned.replaceAll("补贴", "");
// 二、虚假宣传及极限词类
cleaned = cleaned.replaceAll("全网\\s*最低", "");
cleaned = cleaned.replaceAll("史无前例", "");
cleaned = cleaned.replaceAll("100%\\s*有效", "");
cleaned = cleaned.replaceAll("顶级", "");
cleaned = cleaned.replaceAll("独家", "");
cleaned = cleaned.replaceAll("免费\\s*送", "");
cleaned = cleaned.replaceAll("0元\\s*购", "");
cleaned = cleaned.replaceAll("买一送一", "");
cleaned = cleaned.replaceAll("7天瘦20斤", "");
cleaned = cleaned.replaceAll("治愈率100%", "");
// 三、品牌侵权及假货暗示类
cleaned = cleaned.replaceAll("高仿", "");
cleaned = cleaned.replaceAll("A货", "");
cleaned = cleaned.replaceAll("1:1\\s*复刻", "");
cleaned = cleaned.replaceAll("原单", "");
cleaned = cleaned.replaceAll("尾单", "");
cleaned = cleaned.replaceAll("工厂\\s*货", "");
cleaned = cleaned.replaceAll("专柜\\s*验货", ""); // 无授权时违规
// 四、线下导流及规避监管类(多变体覆盖)
cleaned = cleaned.replaceAll("\\s*信", ""); // 匹配"微信""微 信"
cleaned = cleaned.replaceAll("\\s*信", ""); // 谐音变体
cleaned = cleaned.replaceAll("V我", "");
cleaned = cleaned.replaceAll("\\s*卫星", "");
cleaned = cleaned.replaceAll("QQ", "");
cleaned = cleaned.replaceAll("扣扣", ""); // 谐音
cleaned = cleaned.replaceAll("手机\\s*号", "");
cleaned = cleaned.replaceAll("淘宝\\s*链接", "");
cleaned = cleaned.replaceAll("拼多\\s*多", "");
cleaned = cleaned.replaceAll("抖音\\s*同款", "");
// 五、低俗及敏感内容类
cleaned = cleaned.replaceAll("", "");
cleaned = cleaned.replaceAll("垃圾", "");
cleaned = cleaned.replaceAll("笨蛋", "");
cleaned = cleaned.replaceAll("SB", ""); // 单独出现时清理(避免误判可后续加上下文校验)
cleaned = cleaned.replaceAll("原味", "");
cleaned = cleaned.replaceAll("情趣", "");
// 六、医疗及金融风险类
cleaned = cleaned.replaceAll("治疗\\s*三高", "");
cleaned = cleaned.replaceAll("抗癌", "");
cleaned = cleaned.replaceAll("贷款", "");
cleaned = cleaned.replaceAll("套现", "");
cleaned = cleaned.replaceAll("信用卡", "");
// 七、特殊商品及违禁类
cleaned = cleaned.replaceAll("军队", "");
cleaned = cleaned.replaceAll("军工", "");
cleaned = cleaned.replaceAll("警用", "");
cleaned = cleaned.replaceAll("香烟", "");
cleaned = cleaned.replaceAll("电子烟", "");
// 清理每行首尾空格(保持换行)
cleaned = cleaned.replaceAll("(?m)^[ \\t]+|[ \\t]+$", "");
return cleaned;
}
/**
* 调用京东接口生成推广内容