Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
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
Commits
9db11b54
Commit
9db11b54
authored
Nov 02, 2016
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改进 - 初始化时加入黑客派友链
parent
bead500c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletion
+27
-1
src/main/java/org/b3log/solo/service/InitService.java
src/main/java/org/b3log/solo/service/InitService.java
+27
-1
No files found.
src/main/java/org/b3log/solo/service/InitService.java
View file @
9db11b54
...
...
@@ -53,6 +53,7 @@ import org.b3log.solo.repository.ArchiveDateArticleRepository;
import
org.b3log.solo.repository.ArchiveDateRepository
;
import
org.b3log.solo.repository.ArticleRepository
;
import
org.b3log.solo.repository.CommentRepository
;
import
org.b3log.solo.repository.LinkRepository
;
import
org.b3log.solo.repository.OptionRepository
;
import
org.b3log.solo.repository.StatisticRepository
;
import
org.b3log.solo.repository.TagArticleRepository
;
...
...
@@ -70,7 +71,7 @@ import org.json.JSONObject;
* Solo initialization service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.
4.2.10, Sep 13
, 2016
* @version 1.
5.2.10, Nov 2
, 2016
* @since 0.4.0
*/
@Service
...
...
@@ -135,6 +136,12 @@ public class InitService {
@Inject
private
CommentRepository
commentRepository
;
/**
* Link repository.
*/
@Inject
private
LinkRepository
linkRepository
;
/**
* Maximum count of initialization.
*/
...
...
@@ -242,6 +249,7 @@ public class InitService {
initPreference
(
requestJSONObject
);
initReplyNotificationTemplate
();
initAdmin
(
requestJSONObject
);
initLink
();
}
transaction
.
commit
();
...
...
@@ -516,6 +524,24 @@ public class InitService {
LOGGER
.
debug
(
"Initialized admin"
);
}
/**
* Initializes link.
*
* @throws Exception exception
*/
private
void
initLink
()
throws
Exception
{
final
JSONObject
link
=
new
JSONObject
();
link
.
put
(
Link
.
LINK_TITLE
,
"黑客派"
);
link
.
put
(
Link
.
LINK_ADDRESS
,
"https://hacpai.com"
);
link
.
put
(
Link
.
LINK_DESCRIPTION
,
"黑客与画家的社区"
);
final
int
maxOrder
=
linkRepository
.
getMaxOrder
();
link
.
put
(
Link
.
LINK_ORDER
,
maxOrder
+
1
);
final
String
ret
=
linkRepository
.
add
(
link
);
}
/**
* Initializes statistic.
*
...
...
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