Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
solo-1
Commits
9fbebd18
Unverified
Commit
9fbebd18
authored
Nov 13, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
:octocat: 加入一些统计元数据
parent
97428dbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
src/main/java/org/b3log/solo/service/ExportService.java
src/main/java/org/b3log/solo/service/ExportService.java
+28
-1
No files found.
src/main/java/org/b3log/solo/service/ExportService.java
View file @
9fbebd18
...
@@ -51,7 +51,7 @@ import java.util.stream.Collectors;
...
@@ -51,7 +51,7 @@ import java.util.stream.Collectors;
* Export service.
* Export service.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.
1, Sep 18
, 2019
* @version 1.1.1.
2, Nov 13
, 2019
* @since 2.5.0
* @since 2.5.0
*/
*/
@Service
@Service
...
@@ -146,6 +146,24 @@ public class ExportService {
...
@@ -146,6 +146,24 @@ public class ExportService {
@Inject
@Inject
private
OptionQueryService
optionQueryService
;
private
OptionQueryService
optionQueryService
;
/**
* Article query service.
*/
@Inject
private
ArticleQueryService
articleQueryService
;
/**
* Statistic query service.
*/
@Inject
private
StatisticQueryService
statisticQueryService
;
/**
* Tag query service.
*/
@Inject
private
TagQueryService
tagQueryService
;
/**
/**
* Exports public articles to admin's GitHub repos. 博文定时同步 GitHub 仓库 https://hacpai.com/article/1557238327458
* Exports public articles to admin's GitHub repos. 博文定时同步 GitHub 仓库 https://hacpai.com/article/1557238327458
*/
*/
...
@@ -248,6 +266,14 @@ public class ExportService {
...
@@ -248,6 +266,14 @@ public class ExportService {
bodyBuilder
.
append
(
"### 热议\n"
).
append
(
mostCmtBuilder
);
bodyBuilder
.
append
(
"### 热议\n"
).
append
(
mostCmtBuilder
);
}
}
final
JSONObject
stat
=
new
JSONObject
();
stat
.
put
(
"recentArticleTime"
,
articleQueryService
.
getRecentArticleTime
());
final
JSONObject
statistic
=
statisticQueryService
.
getStatistic
();
stat
.
put
(
"articleCount"
,
statistic
.
getLong
(
Option
.
ID_T_STATISTIC_PUBLISHED_ARTICLE_COUNT
));
stat
.
put
(
"commentCount"
,
statistic
.
getLong
(
Option
.
ID_T_STATISTIC_PUBLISHED_BLOG_COMMENT_COUNT
));
stat
.
put
(
"tagCount"
,
tagQueryService
.
getTagCount
());
stat
.
put
(
"favicon"
,
preference
.
optString
(
Option
.
ID_C_FAVICON_URL
));
final
HttpResponse
response
=
HttpRequest
.
post
(
"https://hacpai.com/github/repos"
).
final
HttpResponse
response
=
HttpRequest
.
post
(
"https://hacpai.com/github/repos"
).
connectionTimeout
(
7000
).
timeout
(
60000
).
trustAllCerts
(
true
).
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
connectionTimeout
(
7000
).
timeout
(
60000
).
trustAllCerts
(
true
).
header
(
"User-Agent"
,
Solos
.
USER_AGENT
).
form
(
"userName"
,
userName
,
form
(
"userName"
,
userName
,
...
@@ -259,6 +285,7 @@ public class ExportService {
...
@@ -259,6 +285,7 @@ public class ExportService {
"clientTitle"
,
clientTitle
,
"clientTitle"
,
clientTitle
,
"clientSubtitle"
,
clientSubtitle
,
"clientSubtitle"
,
clientSubtitle
,
"clientBody"
,
bodyBuilder
.
toString
(),
"clientBody"
,
bodyBuilder
.
toString
(),
"stat"
,
stat
.
toString
(),
"file"
,
zipData
).
send
();
"file"
,
zipData
).
send
();
response
.
close
();
response
.
close
();
response
.
charset
(
"UTF-8"
);
response
.
charset
(
"UTF-8"
);
...
...
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