Commit fabaafbb by 马黎滨

Merge branch 'mlbWork' into 'master'

微博采集广告位标志

See merge request !15
parents 9635dc66 5dbdbf3f
......@@ -75,6 +75,11 @@ public class HotSearchCache {
*/
private Integer duration;
/**
* 是否广告位
*/
private Boolean recommend;
public HotSearchCache(String url, String name, String topicLead, Integer highestCount, Integer lastCount, Boolean hot,
......@@ -95,6 +100,11 @@ public class HotSearchCache {
this.duration = duration;
}
public Boolean getRecommend() {
return recommend;
}
public void setRecommend(Boolean recommend) {
this.recommend = recommend;
}
}
......@@ -67,6 +67,13 @@ public class HotSearchCacheDAO {
boolean hot = document.getBoolean("hot")!=null?document.getBoolean("hot"):true;
String url = document.getString("url")!=null?document.getString("url"):null;
String id = name + "_" + type;
boolean recommend = false;
if("微博热搜".equals(type)){
String icon = document.getString("icon");
if("recom".equals(icon)){
recommend = true;
}
}
Document query = new Document("_id", id);
//判断是否为微博推荐位,推荐位微博无排名,所以不纳入总的缓存表
......@@ -102,6 +109,7 @@ public class HotSearchCacheDAO {
nowDoc.put("preRank", preRank);
nowDoc.put("preCount", preCount);
nowDoc.put("duration", durationNow);
nowDoc.put("recommend",recommend);
collection.replaceOne(query, nowDoc);
} else {
nowDoc = new Document();
......@@ -121,7 +129,7 @@ public class HotSearchCacheDAO {
nowDoc.put("duration", durationNow);
nowDoc.put("preRank", null);
nowDoc.put("preCount", null);
nowDoc.put("recommend",recommend);
collection.insertOne(nowDoc);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment