Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
toutiao
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhiwei
toutiao
Commits
cb6a0b84
Commit
cb6a0b84
authored
Jan 07, 2019
by
[zhangzhiwei]
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加文章类型
parent
efe57d38
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
4 deletions
+14
-4
src/main/java/com/zhiwei/toutiao/bean/TouTiaoArticle.java
+11
-1
src/main/java/com/zhiwei/toutiao/parse/TouTiaoArticleParse.java
+0
-0
src/main/java/com/zhiwei/toutiao/parse/TouTiaoChannelParse.java
+1
-1
src/main/java/com/zhiwei/toutiao/parse/TouTiaoParse.java
+1
-1
src/main/java/com/zhiwei/toutiao/parse/TouTiaoSearchParse.java
+1
-1
No files found.
src/main/java/com/zhiwei/toutiao/bean/TouTiaoArticle.java
View file @
cb6a0b84
...
...
@@ -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
+
"]"
;
}
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoArticleParse.java
View file @
cb6a0b84
This diff is collapsed.
Click to expand it.
src/main/java/com/zhiwei/toutiao/parse/TouTiaoChannelParse.java
View file @
cb6a0b84
...
...
@@ -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
;
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoParse.java
View file @
cb6a0b84
...
...
@@ -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
{
...
...
src/main/java/com/zhiwei/toutiao/parse/TouTiaoSearchParse.java
View file @
cb6a0b84
...
...
@@ -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
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment