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
d9b5fe64
Unverified
Commit
d9b5fe64
authored
Jan 28, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
#12633
parent
a90fc29d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
17 deletions
+9
-17
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
+1
-2
src/main/java/org/b3log/solo/processor/TagProcessor.java
src/main/java/org/b3log/solo/processor/TagProcessor.java
+1
-5
src/main/java/org/b3log/solo/processor/console/TagConsole.java
...ain/java/org/b3log/solo/processor/console/TagConsole.java
+2
-2
src/main/java/org/b3log/solo/service/ArchiveDateQueryService.java
.../java/org/b3log/solo/service/ArchiveDateQueryService.java
+1
-2
src/main/java/org/b3log/solo/service/ArticleQueryService.java
...main/java/org/b3log/solo/service/ArticleQueryService.java
+2
-1
src/main/java/org/b3log/solo/service/TagQueryService.java
src/main/java/org/b3log/solo/service/TagQueryService.java
+2
-5
No files found.
src/main/java/org/b3log/solo/processor/ArticleProcessor.java
View file @
d9b5fe64
...
@@ -409,8 +409,7 @@ public class ArticleProcessor {
...
@@ -409,8 +409,7 @@ public class ArticleProcessor {
}
}
final
List
<
JSONObject
>
articles
=
(
List
<
JSONObject
>)
tagArticleResult
.
opt
(
Keys
.
RESULTS
);
final
List
<
JSONObject
>
articles
=
(
List
<
JSONObject
>)
tagArticleResult
.
opt
(
Keys
.
RESULTS
);
final
int
tagArticleCount
=
tagArticleResult
.
optJSONObject
(
Pagination
.
PAGINATION
).
optInt
(
Pagination
.
PAGINATION_PAGE_COUNT
);
final
int
pageCount
=
tagArticleResult
.
optJSONObject
(
Pagination
.
PAGINATION
).
optInt
(
Pagination
.
PAGINATION_PAGE_COUNT
);
final
int
pageCount
=
(
int
)
Math
.
ceil
((
double
)
tagArticleCount
/
(
double
)
pageSize
);
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
final
JSONObject
result
=
new
JSONObject
();
final
JSONObject
result
=
new
JSONObject
();
...
...
src/main/java/org/b3log/solo/processor/TagProcessor.java
View file @
d9b5fe64
...
@@ -141,12 +141,8 @@ public class TagProcessor {
...
@@ -141,12 +141,8 @@ public class TagProcessor {
final
List
<
JSONObject
>
articles
=
(
List
<
JSONObject
>)
tagArticleResult
.
opt
(
Keys
.
RESULTS
);
final
List
<
JSONObject
>
articles
=
(
List
<
JSONObject
>)
tagArticleResult
.
opt
(
Keys
.
RESULTS
);
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
dataModelService
.
setArticlesExProperties
(
context
,
articles
,
preference
);
final
int
tagArticleCount
=
tagArticleResult
.
optJSONObject
(
Pagination
.
PAGINATION
).
optInt
(
Pagination
.
PAGINATION_PAGE_COUNT
);
final
int
pageCount
=
tagArticleResult
.
optJSONObject
(
Pagination
.
PAGINATION
).
optInt
(
Pagination
.
PAGINATION_PAGE_COUNT
);
final
int
pageCount
=
(
int
)
Math
.
ceil
((
double
)
tagArticleCount
/
(
double
)
pageSize
);
LOGGER
.
log
(
Level
.
TRACE
,
"Paginate tag-articles [currentPageNum={0}, pageSize={1}, pageCount={2}, windowSize={3}]"
,
currentPageNum
,
pageSize
,
pageCount
,
windowSize
);
final
List
<
Integer
>
pageNums
=
Paginator
.
paginate
(
currentPageNum
,
pageSize
,
pageCount
,
windowSize
);
final
List
<
Integer
>
pageNums
=
Paginator
.
paginate
(
currentPageNum
,
pageSize
,
pageCount
,
windowSize
);
LOGGER
.
log
(
Level
.
TRACE
,
"tag-articles [pageNums={0}]"
,
pageNums
);
fillPagination
(
dataModel
,
pageCount
,
currentPageNum
,
articles
,
pageNums
);
fillPagination
(
dataModel
,
pageCount
,
currentPageNum
,
articles
,
pageNums
);
dataModel
.
put
(
Common
.
PATH
,
"/tags/"
+
URLs
.
encode
(
tagTitle
));
dataModel
.
put
(
Common
.
PATH
,
"/tags/"
+
URLs
.
encode
(
tagTitle
));
dataModel
.
put
(
Keys
.
OBJECT_ID
,
tagId
);
dataModel
.
put
(
Keys
.
OBJECT_ID
,
tagId
);
...
...
src/main/java/org/b3log/solo/processor/console/TagConsole.java
View file @
d9b5fe64
...
@@ -76,7 +76,7 @@ public class TagConsole {
...
@@ -76,7 +76,7 @@ public class TagConsole {
* {
* {
* "sc": boolean,
* "sc": boolean,
* "tags": [
* "tags": [
* {"tagTitle": "",
tagReferenceCount": int,
....},
* {"tagTitle": "", ....},
* ....
* ....
* ]
* ]
* }
* }
...
@@ -110,7 +110,7 @@ public class TagConsole {
...
@@ -110,7 +110,7 @@ public class TagConsole {
* {
* {
* "sc": boolean,
* "sc": boolean,
* "unusedTags": [
* "unusedTags": [
* {"tagTitle": "",
tagReferenceCount": int,
....},
* {"tagTitle": "", ....},
* ....
* ....
* ]
* ]
* }
* }
...
...
src/main/java/org/b3log/solo/service/ArchiveDateQueryService.java
View file @
d9b5fe64
...
@@ -93,8 +93,7 @@ public class ArchiveDateQueryService {
...
@@ -93,8 +93,7 @@ public class ArchiveDateQueryService {
* "archiveDate": {
* "archiveDate": {
* "oId": "",
* "oId": "",
* "archiveTime": "",
* "archiveTime": "",
* "archiveDatePublishedArticleCount": int,
* "archiveDatePublishedArticleCount": int
* "archiveDateArticleCount": int
* }
* }
* }
* }
* </pre>, returns {@code null} if not found
* </pre>, returns {@code null} if not found
...
...
src/main/java/org/b3log/solo/service/ArticleQueryService.java
View file @
d9b5fe64
...
@@ -630,6 +630,7 @@ public class ArticleQueryService {
...
@@ -630,6 +630,7 @@ public class ArticleQueryService {
if
(
0
==
tagArticleRelations
.
length
())
{
if
(
0
==
tagArticleRelations
.
length
())
{
return
null
;
return
null
;
}
}
final
JSONObject
pagination
=
result
.
optJSONObject
(
Pagination
.
PAGINATION
);
final
Set
<
String
>
articleIds
=
new
HashSet
<>();
final
Set
<
String
>
articleIds
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
tagArticleRelations
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
tagArticleRelations
.
length
();
i
++)
{
...
@@ -656,7 +657,7 @@ public class ArticleQueryService {
...
@@ -656,7 +657,7 @@ public class ArticleQueryService {
retArticles
.
add
(
article
);
retArticles
.
add
(
article
);
}
}
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
Pagination
.
PAGINATION
,
result
.
optJSONObject
(
Pagination
.
PAGINATION
)
);
ret
.
put
(
Pagination
.
PAGINATION
,
pagination
);
ret
.
put
(
Keys
.
RESULTS
,
(
Object
)
retArticles
);
ret
.
put
(
Keys
.
RESULTS
,
(
Object
)
retArticles
);
return
ret
;
return
ret
;
...
...
src/main/java/org/b3log/solo/service/TagQueryService.java
View file @
d9b5fe64
...
@@ -77,7 +77,6 @@ public class TagQueryService {
...
@@ -77,7 +77,6 @@ public class TagQueryService {
* "tag": {
* "tag": {
* "oId": "",
* "oId": "",
* "tagTitle": "",
* "tagTitle": "",
* "tagReferenceCount": int,
* "tagPublishedRefCount": int
* "tagPublishedRefCount": int
* }
* }
* }
* }
...
@@ -86,15 +85,13 @@ public class TagQueryService {
...
@@ -86,15 +85,13 @@ public class TagQueryService {
*/
*/
public
JSONObject
getTagByTitle
(
final
String
tagTitle
)
throws
ServiceException
{
public
JSONObject
getTagByTitle
(
final
String
tagTitle
)
throws
ServiceException
{
try
{
try
{
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
tag
=
tagRepository
.
getByTitle
(
tagTitle
);
final
JSONObject
tag
=
tagRepository
.
getByTitle
(
tagTitle
);
if
(
null
==
tag
)
{
if
(
null
==
tag
)
{
return
null
;
return
null
;
}
}
final
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
Tag
.
TAG
,
tag
);
ret
.
put
(
Tag
.
TAG
,
tag
);
LOGGER
.
log
(
Level
.
DEBUG
,
"Got an tag[title={0}]"
,
tagTitle
);
return
ret
;
return
ret
;
}
catch
(
final
RepositoryException
e
)
{
}
catch
(
final
RepositoryException
e
)
{
...
@@ -123,7 +120,7 @@ public class TagQueryService {
...
@@ -123,7 +120,7 @@ public class TagQueryService {
*
*
* @return for example, <pre>
* @return for example, <pre>
* [
* [
* {"tagTitle": "",
"tagReferenceCount": int,
....},
* {"tagTitle": "", ....},
* ....
* ....
* ]
* ]
* </pre>, returns an empty list if not found
* </pre>, returns an empty list if not found
...
...
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