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
b52e020b
Commit
b52e020b
authored
Jun 15, 2017
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🐛
修复评论人头像不显示问题
https://hacpai.com/article/1497494920030
parent
a7d76399
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
src/main/java/org/b3log/solo/service/CommentQueryService.java
...main/java/org/b3log/solo/service/CommentQueryService.java
+13
-16
No files found.
src/main/java/org/b3log/solo/service/CommentQueryService.java
View file @
b52e020b
...
...
@@ -50,7 +50,7 @@ import java.util.List;
* Comment query service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.
0.9, Feb 18
, 2017
* @version 1.3.
1.9, Jun 15
, 2017
* @since 0.3.5
*/
@Service
...
...
@@ -59,7 +59,7 @@ public class CommentQueryService {
/**
* Logger.
*/
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
CommentQueryService
.
class
.
getName
()
);
private
static
final
Logger
LOGGER
=
Logger
.
getLogger
(
CommentQueryService
.
class
);
/**
* User service.
...
...
@@ -89,7 +89,7 @@ public class CommentQueryService {
* Can the current user access a comment specified by the given comment id?
*
* @param commentId the given comment id
* @param request the specified request
* @param request
the specified request
* @return {@code true} if the current user can access the comment, {@code false} otherwise
* @throws Exception exception
*/
...
...
@@ -104,7 +104,6 @@ public class CommentQueryService {
// Here, you are not admin
final
JSONObject
comment
=
commentRepository
.
get
(
commentId
);
if
(
null
==
comment
)
{
return
false
;
}
...
...
@@ -117,7 +116,6 @@ public class CommentQueryService {
}
final
JSONObject
article
=
articleRepository
.
get
(
onId
);
if
(
null
==
article
)
{
return
false
;
}
...
...
@@ -130,15 +128,12 @@ public class CommentQueryService {
/**
* Gets comments with the specified request json object, request and response.
*
* @param requestJSONObject the specified request json object, for example, <pre>
* {
* "paginationCurrentPageNum": 1,
* "paginationPageSize": 20,
* "paginationWindowSize": 10
* }, see {@link Pagination} for more details
* </pre>
*
* @return for example, <pre>
* @param requestJSONObject the specified request json object, for example,
* "paginationCurrentPageNum": 1,
* "paginationPageSize": 20,
* "paginationWindowSize": 10
* @return for example,
* <pre>
* {
* "comments": [{
* "oId": "",
...
...
@@ -154,7 +149,6 @@ public class CommentQueryService {
* "sc": "GET_COMMENTS_SUCC"
* }
* </pre>
*
* @throws ServiceException service exception
* @see Pagination
*/
...
...
@@ -246,7 +240,10 @@ public class CommentQueryService {
final
String
email
=
comment
.
optString
(
Comment
.
COMMENT_EMAIL
);
comment
.
put
(
Comment
.
COMMENT_THUMBNAIL_URL
,
Thumbnails
.
getGravatarURL
(
email
,
"128"
));
final
String
thumbnailURL
=
comment
.
optString
(
Comment
.
COMMENT_THUMBNAIL_URL
);
if
(
Strings
.
isEmptyOrNull
(
thumbnailURL
))
{
comment
.
put
(
Comment
.
COMMENT_THUMBNAIL_URL
,
Thumbnails
.
getGravatarURL
(
email
,
"128"
));
}
if
(!
Strings
.
isEmptyOrNull
(
comment
.
optString
(
Comment
.
COMMENT_ORIGINAL_COMMENT_ID
)))
{
// This comment is a reply
...
...
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