|
|
@@ -75,10 +75,10 @@ public class PopularFeelingsServiceImpl extends ServiceImpl<PopularFeelingsMappe
|
|
|
|
|
|
String[] listKeywords = popular.getKeywords().split(",");
|
|
|
|
|
|
- boolean flag = false;
|
|
|
+ boolean flag = true;
|
|
|
for (String k : listKeywords) {
|
|
|
- flag = bodyText.contains(k);
|
|
|
- if (flag) {
|
|
|
+ if (!bodyText.contains(k)) {
|
|
|
+ flag = false;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -187,10 +187,10 @@ public class PopularFeelingsServiceImpl extends ServiceImpl<PopularFeelingsMappe
|
|
|
for (Element element : elements) {
|
|
|
String metaName = element.attr("name");
|
|
|
String metaContent = element.attr("content");
|
|
|
- if ("keywords".equals(metaName)) {
|
|
|
+ if (StringUtils.equalsIgnoreCase("keywords", metaName)) {
|
|
|
keywords = metaContent;
|
|
|
}
|
|
|
- if ("description".equals(metaName)) {
|
|
|
+ if (StringUtils.equalsIgnoreCase("description", metaName)) {
|
|
|
description = metaContent;
|
|
|
}
|
|
|
}
|
|
|
@@ -200,8 +200,8 @@ public class PopularFeelingsServiceImpl extends ServiceImpl<PopularFeelingsMappe
|
|
|
description = bodyText.length() >= 200 ? bodyText.substring(0, 200) : bodyText;
|
|
|
}
|
|
|
|
|
|
- if (StringUtils.isBlank(keywords) && StringUtils.isNotBlank(bodyText)) {
|
|
|
- description = keywords;
|
|
|
+ if (StringUtils.isBlank(keywords) && StringUtils.isNotBlank(description)) {
|
|
|
+ keywords = description;
|
|
|
}
|
|
|
|
|
|
|