Commit 58bf7554 by zhiwei

推送时间调整

parent 54ec120f
......@@ -21,13 +21,13 @@ public class SendWeiboHotSearchRun extends Thread{
@Override
public void run() {
List<DBObject> list = weiboHotSearchDAO.getWeiboHotOneHour();
System.out.println(list.size());
Calendar calendar = Calendar.getInstance();
if(list!=null && list.size()>0){
for(DBObject weibo : list){
String title = weibo.get("name").toString();
String time = TimeParse.dateFormartString((Date)weibo.get("time"), "yyyy-MM-dd HH:mm:ss");
String url = weibo.get("url").toString();
if(Calendar.HOUR > 6 && Calendar.HOUR < 23){
if(calendar.get(Calendar.HOUR_OF_DAY) > 6 && calendar.get(Calendar.HOUR_OF_DAY) < 23){
sendTemplateByUserIds(title, time, url);
}
}
......
......@@ -20,12 +20,13 @@ public class SendZhihuHotSearchRun extends Thread{
@Override
public void run() {
List<DBObject> list = zhihuHotSearchDAO.getZhiHuHotSearch();
Calendar calendar = Calendar.getInstance();
if(list!=null && list.size()>0){
for(DBObject zhihu : list){
String title = zhihu.get("display_query").toString();
String time = TimeParse.dateFormartString((Date)zhihu.get("time"), "yyyy-MM-dd HH:mm:ss");
String url = zhihu.get("_id").toString();
if(Calendar.HOUR > 6 && Calendar.HOUR < 23){
if(calendar.get(Calendar.HOUR_OF_DAY) > 6 && calendar.get(Calendar.HOUR_OF_DAY) < 23){
sendTemplateByUserIds(title, time, url);
}
}
......
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