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
294ceb70
Unverified
Commit
294ceb70
authored
Mar 16, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Cleanup code
parent
f0819989
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
src/main/java/org/b3log/solo/service/CommentMgmtService.java
src/main/java/org/b3log/solo/service/CommentMgmtService.java
+1
-8
No files found.
src/main/java/org/b3log/solo/service/CommentMgmtService.java
View file @
294ceb70
...
...
@@ -51,7 +51,7 @@ import java.util.Date;
* Comment management service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.3.
6, Mar 3
, 2019
* @version 1.3.3.
7, Mar 16
, 2019
* @since 0.3.5
*/
@Service
...
...
@@ -400,12 +400,9 @@ public class CommentMgmtService {
final
String
commentName
=
requestJSONObject
.
getString
(
Comment
.
COMMENT_NAME
);
final
String
commentURL
=
requestJSONObject
.
optString
(
Comment
.
COMMENT_URL
);
final
String
commentContent
=
requestJSONObject
.
getString
(
Comment
.
COMMENT_CONTENT
);
final
String
originalCommentId
=
requestJSONObject
.
optString
(
Comment
.
COMMENT_ORIGINAL_COMMENT_ID
);
ret
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_ID
,
originalCommentId
);
// Step 1: Add comment
final
JSONObject
comment
=
new
JSONObject
();
comment
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_ID
,
""
);
comment
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_NAME
,
""
);
comment
.
put
(
Comment
.
COMMENT_NAME
,
commentName
);
...
...
@@ -415,14 +412,11 @@ public class CommentMgmtService {
comment
.
put
(
Comment
.
COMMENT_ORIGINAL_COMMENT_NAME
,
requestJSONObject
.
optString
(
Comment
.
COMMENT_ORIGINAL_COMMENT_NAME
));
final
JSONObject
preference
=
optionQueryService
.
getPreference
();
final
Date
date
=
new
Date
();
comment
.
put
(
Comment
.
COMMENT_CREATED
,
date
.
getTime
());
ret
.
put
(
Comment
.
COMMENT_T_DATE
,
DateFormatUtils
.
format
(
date
,
"yyyy-MM-dd HH:mm:ss"
));
ret
.
put
(
"commentDate2"
,
date
);
ret
.
put
(
Common
.
COMMENTABLE
,
preference
.
getBoolean
(
Option
.
ID_C_COMMENTABLE
)
&&
article
.
getBoolean
(
Article
.
ARTICLE_COMMENTABLE
));
ret
.
put
(
Common
.
PERMALINK
,
article
.
getString
(
Article
.
ARTICLE_PERMALINK
));
ret
.
put
(
Comment
.
COMMENT_NAME
,
commentName
);
String
cmtContent
=
Emotions
.
convert
(
commentContent
);
cmtContent
=
Markdowns
.
toHTML
(
cmtContent
);
...
...
@@ -451,7 +445,6 @@ public class CommentMgmtService {
comment
.
put
(
Comment
.
COMMENT_ON_ID
,
articleId
);
comment
.
put
(
Comment
.
COMMENT_ON_TYPE
,
Article
.
ARTICLE
);
final
String
commentId
=
Ids
.
genTimeMillisId
();
comment
.
put
(
Keys
.
OBJECT_ID
,
commentId
);
ret
.
put
(
Keys
.
OBJECT_ID
,
commentId
);
final
String
commentSharpURL
=
Comment
.
getCommentSharpURLForArticle
(
article
,
commentId
);
...
...
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