Commit cb6a0b84 by [zhangzhiwei]

添加文章类型

parent efe57d38
......@@ -35,7 +35,14 @@ public class TouTiaoArticle implements Serializable{
private String readNum;
private String shareNum;
private List<String> labelList;
private String articleType;
public String getArticleType() {
return articleType;
}
public void setArticleType(String articleType) {
this.articleType = articleType;
}
public String getCommentCount() {
return commentCount;
}
......@@ -113,7 +120,8 @@ public class TouTiaoArticle implements Serializable{
public TouTiaoArticle(){}
public TouTiaoArticle(String url,String title,String user_id,
String source,Date time,String content,String commentCount,
String playCount,String readNum, String shareNum,String type)
String playCount,String readNum, String shareNum,String type
,String articleType)
{
this.url = url ;
this.title = title;
......@@ -126,6 +134,7 @@ public class TouTiaoArticle implements Serializable{
this.playCount = playCount;
this.shareNum = shareNum;
this.commentCount = commentCount;
this.articleType = articleType;
}
public String toString()
......@@ -143,6 +152,7 @@ public class TouTiaoArticle implements Serializable{
+ ", readNum = " + readNum
+ ", shareNum = " + shareNum
+ ", labelList = " + labelList
+ ", articleType = " + articleType
+ "]";
}
......
......@@ -98,7 +98,7 @@ public class TouTiaoChannelParse {
}
url = getUrl(url);
date = TimeParse.stringFormartDate(time);
TouTiaoArticle tt = new TouTiaoArticle(url, title, null,source, date, content, comment_count, "-1", "-1", "-1","今日头条");
TouTiaoArticle tt = new TouTiaoArticle(url, title, null,source, date, content, comment_count, "-1", "-1", "-1","今日头条",null);
ttList.add(tt);
} catch (JSONException e) {
continue;
......
......@@ -152,7 +152,7 @@ public class TouTiaoParse {
String shareNum = data.getString("share_count");
if (endData.before(date)) {
TouTiaoArticle tt = new TouTiaoArticle(href, title, null,source, date, content, commentNum, playNum, readNum, shareNum,"今日头条");
TouTiaoArticle tt = new TouTiaoArticle(href, title, null,source, date, content, commentNum, playNum, readNum, shareNum,"今日头条",null);
dataList.add(tt);
}else
{
......
......@@ -90,7 +90,7 @@ public class TouTiaoSearchParse {
String user_id = jso.getString("user_id");
Date date = TimeParse.stringFormartDate(time);
TouTiaoArticle tt = new TouTiaoArticle(url, title, user_id,source, date, content, comment_count, "-1", "-1", "-1","今日头条");
TouTiaoArticle tt = new TouTiaoArticle(url, title, user_id,source, date, content, comment_count, "-1", "-1", "-1","今日头条",null);
ttList.add(tt);
} catch (JSONException e) {
logger.debug("解析数据出现问题", e.fillInStackTrace());
......
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