Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
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
Commits
1caf8219
Commit
1caf8219
authored
Apr 10, 2014
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #345
parent
49e05437
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
core/src/main/java/org/b3log/solo/processor/CommentProcessor.java
.../main/java/org/b3log/solo/processor/CommentProcessor.java
+15
-4
No files found.
core/src/main/java/org/b3log/solo/processor/CommentProcessor.java
View file @
1caf8219
...
@@ -38,6 +38,7 @@ import org.b3log.solo.model.Comment;
...
@@ -38,6 +38,7 @@ import org.b3log.solo.model.Comment;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Common
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.model.Page
;
import
org.b3log.solo.service.CommentMgmtService
;
import
org.b3log.solo.service.CommentMgmtService
;
import
org.b3log.solo.service.UserMgmtService
;
import
org.b3log.solo.service.UserQueryService
;
import
org.b3log.solo.service.UserQueryService
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
...
@@ -47,7 +48,7 @@ import org.json.JSONObject;
...
@@ -47,7 +48,7 @@ import org.json.JSONObject;
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author ArmstrongCN
* @author ArmstrongCN
* @version 1.1.
0.12, Oct 26, 2013
* @version 1.1.
1.12, Apr 10, 2014
* @since 0.3.1
* @since 0.3.1
*/
*/
@RequestProcessor
@RequestProcessor
...
@@ -76,6 +77,12 @@ public class CommentProcessor {
...
@@ -76,6 +77,12 @@ public class CommentProcessor {
@Inject
@Inject
private
UserQueryService
userQueryService
;
private
UserQueryService
userQueryService
;
/**
* User management service.
*/
@Inject
private
UserMgmtService
userMgmtService
;
/**
/**
* Adds a comment to a page.
* Adds a comment to a page.
*
*
...
@@ -115,7 +122,7 @@ public class CommentProcessor {
...
@@ -115,7 +122,7 @@ public class CommentProcessor {
requestJSONObject
.
put
(
Common
.
TYPE
,
Page
.
PAGE
);
requestJSONObject
.
put
(
Common
.
TYPE
,
Page
.
PAGE
);
fillCommenter
(
requestJSONObject
,
httpServletRequest
);
fillCommenter
(
requestJSONObject
,
httpServletRequest
,
httpServletResponse
);
final
JSONObject
jsonObject
=
commentMgmtService
.
checkAddCommentRequest
(
requestJSONObject
);
final
JSONObject
jsonObject
=
commentMgmtService
.
checkAddCommentRequest
(
requestJSONObject
);
...
@@ -209,7 +216,7 @@ public class CommentProcessor {
...
@@ -209,7 +216,7 @@ public class CommentProcessor {
requestJSONObject
.
put
(
Common
.
TYPE
,
Article
.
ARTICLE
);
requestJSONObject
.
put
(
Common
.
TYPE
,
Article
.
ARTICLE
);
fillCommenter
(
requestJSONObject
,
httpServletRequest
);
fillCommenter
(
requestJSONObject
,
httpServletRequest
,
httpServletResponse
);
final
JSONObject
jsonObject
=
commentMgmtService
.
checkAddCommentRequest
(
requestJSONObject
);
final
JSONObject
jsonObject
=
commentMgmtService
.
checkAddCommentRequest
(
requestJSONObject
);
...
@@ -267,8 +274,12 @@ public class CommentProcessor {
...
@@ -267,8 +274,12 @@ public class CommentProcessor {
*
*
* @param requestJSONObject the specified request json object
* @param requestJSONObject the specified request json object
* @param httpServletRequest the specified HTTP servlet request
* @param httpServletRequest the specified HTTP servlet request
* @param httpServletResponse the specified HTTP servlet response
*/
*/
private
void
fillCommenter
(
final
JSONObject
requestJSONObject
,
final
HttpServletRequest
httpServletRequest
)
{
private
void
fillCommenter
(
final
JSONObject
requestJSONObject
,
final
HttpServletRequest
httpServletRequest
,
final
HttpServletResponse
httpServletResponse
)
{
userMgmtService
.
tryLogInWithCookie
(
httpServletRequest
,
httpServletResponse
);
final
JSONObject
currentUser
=
userQueryService
.
getCurrentUser
(
httpServletRequest
);
final
JSONObject
currentUser
=
userQueryService
.
getCurrentUser
(
httpServletRequest
);
if
(
null
==
currentUser
)
{
if
(
null
==
currentUser
)
{
...
...
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