Commit cb6a0b84 by [zhangzhiwei]

添加文章类型

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