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
eb69e76b
Unverified
Commit
eb69e76b
authored
Jan 28, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
#12633
parent
2188c8a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
5 deletions
+2
-5
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
+2
-2
src/main/java/org/b3log/solo/service/DataModelService.java
src/main/java/org/b3log/solo/service/DataModelService.java
+0
-3
No files found.
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
eb69e76b
...
...
@@ -507,7 +507,7 @@ public class ArticleProcessor {
}
final
JSONObject
articlesResult
=
articleQueryService
.
getArticlesByAuthorId
(
authorId
,
currentPageNum
,
pageSize
);
final
List
<
JSONObject
>
articles
=
CollectionUtils
.
jsonArrayToList
(
articlesResult
.
optJSONArray
(
Keys
.
OBJECT_ID
));
final
List
<
JSONObject
>
articles
=
CollectionUtils
.
jsonArrayToList
(
articlesResult
.
optJSONArray
(
Keys
.
RESULTS
));
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
final
int
pageCount
=
articlesResult
.
optJSONObject
(
Pagination
.
PAGINATION
).
optInt
(
Pagination
.
PAGINATION_PAGE_COUNT
);
...
...
@@ -568,7 +568,7 @@ public class ArticleProcessor {
return
;
}
final
List
<
JSONObject
>
articles
=
CollectionUtils
.
jsonArrayToList
(
articlesResult
.
optJSONArray
(
Keys
.
OBJECT_ID
));
final
List
<
JSONObject
>
articles
=
CollectionUtils
.
jsonArrayToList
(
articlesResult
.
optJSONArray
(
Keys
.
RESULTS
));
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
final
int
pageCount
=
articlesResult
.
optJSONObject
(
Pagination
.
PAGINATION
).
optInt
(
Pagination
.
PAGINATION_PAGE_COUNT
);
final
List
<
Integer
>
pageNums
=
Paginator
.
paginate
(
currentPageNum
,
pageSize
,
pageCount
,
windowSize
);
...
...
src/main/java/org/b3log/solo/service/DataModelService.java
View file @
eb69e76b
...
...
@@ -199,7 +199,6 @@ public class DataModelService {
if
(
Templates
.
hasExpression
(
template
,
"<#list articles1 as article>"
))
{
isArticles1
=
true
;
query
.
addSort
(
Article
.
ARTICLE_CREATED
,
SortDirection
.
DESCENDING
);
LOGGER
.
trace
(
"Query ${articles1} in index.ftl"
);
}
else
{
// <#list articles as article>
query
.
addSort
(
Article
.
ARTICLE_PUT_TOP
,
SortDirection
.
DESCENDING
);
...
...
@@ -220,11 +219,9 @@ public class DataModelService {
dataModel
.
put
(
Pagination
.
PAGINATION_FIRST_PAGE_NUM
,
pageNums
.
get
(
0
));
dataModel
.
put
(
Pagination
.
PAGINATION_LAST_PAGE_NUM
,
pageNums
.
get
(
pageNums
.
size
()
-
1
));
}
dataModel
.
put
(
Pagination
.
PAGINATION_PAGE_COUNT
,
pageCount
);
dataModel
.
put
(
Pagination
.
PAGINATION_PAGE_NUMS
,
pageNums
);
if
(!
isArticles1
)
{
dataModel
.
put
(
Article
.
ARTICLES
,
articles
);
}
else
{
...
...
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