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
d36ce8a4
Unverified
Commit
d36ce8a4
authored
Jan 28, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
#12633
parent
1d9e6775
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
src/main/java/org/b3log/solo/repository/ArticleRepository.java
...ain/java/org/b3log/solo/repository/ArticleRepository.java
+8
-0
src/main/java/org/b3log/solo/service/ArticleMgmtService.java
src/main/java/org/b3log/solo/service/ArticleMgmtService.java
+7
-0
No files found.
src/main/java/org/b3log/solo/repository/ArticleRepository.java
View file @
d36ce8a4
...
@@ -262,6 +262,10 @@ public class ArticleRepository extends AbstractRepository {
...
@@ -262,6 +262,10 @@ public class ArticleRepository extends AbstractRepository {
*/
*/
public
JSONObject
getPreviousArticle
(
final
String
articleId
)
throws
RepositoryException
{
public
JSONObject
getPreviousArticle
(
final
String
articleId
)
throws
RepositoryException
{
final
JSONObject
currentArticle
=
get
(
articleId
);
final
JSONObject
currentArticle
=
get
(
articleId
);
if
(
null
==
currentArticle
)
{
return
null
;
}
final
long
currentArticleCreated
=
currentArticle
.
optLong
(
Article
.
ARTICLE_CREATED
);
final
long
currentArticleCreated
=
currentArticle
.
optLong
(
Article
.
ARTICLE_CREATED
);
final
Query
query
=
new
Query
().
final
Query
query
=
new
Query
().
...
@@ -309,6 +313,10 @@ public class ArticleRepository extends AbstractRepository {
...
@@ -309,6 +313,10 @@ public class ArticleRepository extends AbstractRepository {
*/
*/
public
JSONObject
getNextArticle
(
final
String
articleId
)
throws
RepositoryException
{
public
JSONObject
getNextArticle
(
final
String
articleId
)
throws
RepositoryException
{
final
JSONObject
currentArticle
=
get
(
articleId
);
final
JSONObject
currentArticle
=
get
(
articleId
);
if
(
null
==
currentArticle
)
{
return
null
;
}
final
long
currentArticleCreated
=
currentArticle
.
optLong
(
Article
.
ARTICLE_CREATED
);
final
long
currentArticleCreated
=
currentArticle
.
optLong
(
Article
.
ARTICLE_CREATED
);
final
Query
query
=
new
Query
().
final
Query
query
=
new
Query
().
...
...
src/main/java/org/b3log/solo/service/ArticleMgmtService.java
View file @
d36ce8a4
...
@@ -727,12 +727,19 @@ public class ArticleMgmtService {
...
@@ -727,12 +727,19 @@ public class ArticleMgmtService {
if
(
tagIdList
.
isEmpty
())
{
// Removes all if un-specified
if
(
tagIdList
.
isEmpty
())
{
// Removes all if un-specified
relationId
=
tagArticleRelation
.
getString
(
Keys
.
OBJECT_ID
);
relationId
=
tagArticleRelation
.
getString
(
Keys
.
OBJECT_ID
);
tagArticleRepository
.
remove
(
relationId
);
tagArticleRepository
.
remove
(
relationId
);
}
else
{
}
else
{
if
(
tagIdList
.
contains
(
tagArticleRelation
.
getString
(
Tag
.
TAG
+
"_"
+
Keys
.
OBJECT_ID
)))
{
if
(
tagIdList
.
contains
(
tagArticleRelation
.
getString
(
Tag
.
TAG
+
"_"
+
Keys
.
OBJECT_ID
)))
{
relationId
=
tagArticleRelation
.
getString
(
Keys
.
OBJECT_ID
);
relationId
=
tagArticleRelation
.
getString
(
Keys
.
OBJECT_ID
);
tagArticleRepository
.
remove
(
relationId
);
tagArticleRepository
.
remove
(
relationId
);
}
}
}
}
final
String
tagId
=
tagArticleRelation
.
optString
(
Tag
.
TAG
+
"_"
+
Keys
.
OBJECT_ID
);
final
int
articleCount
=
tagArticleRepository
.
getArticleCount
(
tagId
);
if
(
1
>
articleCount
)
{
tagRepository
.
remove
(
tagId
);
}
}
}
}
}
...
...
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