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
c6a7cb12
Unverified
Commit
c6a7cb12
authored
Jan 13, 2019
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
Cleanup code
parent
d8e3f581
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
src/main/java/org/b3log/solo/processor/console/ArticleConsole.java
...java/org/b3log/solo/processor/console/ArticleConsole.java
+1
-15
No files found.
src/main/java/org/b3log/solo/processor/console/ArticleConsole.java
View file @
c6a7cb12
...
@@ -44,7 +44,6 @@ import org.json.JSONArray;
...
@@ -44,7 +44,6 @@ import org.json.JSONArray;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -52,7 +51,7 @@ import java.util.stream.Collectors;
...
@@ -52,7 +51,7 @@ import java.util.stream.Collectors;
* Article console request processing.
* Article console request processing.
*
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.
6, Dec 10, 2018
* @version 1.1.1.
7, Jan 13, 2019
* @since 0.4.0
* @since 0.4.0
*/
*/
@Singleton
@Singleton
...
@@ -143,7 +142,6 @@ public class ArticleConsole {
...
@@ -143,7 +142,6 @@ public class ArticleConsole {
final
JSONObject
result
=
new
JSONObject
();
final
JSONObject
result
=
new
JSONObject
();
renderer
.
setJSONObject
(
result
);
renderer
.
setJSONObject
(
result
);
result
.
put
(
Keys
.
STATUS_CODE
,
true
);
result
.
put
(
Keys
.
STATUS_CODE
,
true
);
final
HttpServletRequest
request
=
context
.
getRequest
();
final
String
markdownText
=
context
.
param
(
"markdownText"
);
final
String
markdownText
=
context
.
param
(
"markdownText"
);
if
(
StringUtils
.
isBlank
(
markdownText
))
{
if
(
StringUtils
.
isBlank
(
markdownText
))
{
result
.
put
(
"html"
,
""
);
result
.
put
(
"html"
,
""
);
...
@@ -307,8 +305,6 @@ public class ArticleConsole {
...
@@ -307,8 +305,6 @@ public class ArticleConsole {
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
renderer
.
setJSONObject
(
ret
);
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
final
String
articleId
=
context
.
pathVar
(
"id"
);
final
String
articleId
=
context
.
pathVar
(
"id"
);
final
JSONObject
currentUser
=
Solos
.
getCurrentUser
(
context
.
getRequest
(),
context
.
getResponse
());
final
JSONObject
currentUser
=
Solos
.
getCurrentUser
(
context
.
getRequest
(),
context
.
getResponse
());
...
@@ -354,8 +350,6 @@ public class ArticleConsole {
...
@@ -354,8 +350,6 @@ public class ArticleConsole {
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
renderer
.
setJSONObject
(
ret
);
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
try
{
try
{
final
String
articleId
=
context
.
pathVar
(
"id"
);
final
String
articleId
=
context
.
pathVar
(
"id"
);
final
JSONObject
currentUser
=
Solos
.
getCurrentUser
(
context
.
getRequest
(),
context
.
getResponse
());
final
JSONObject
currentUser
=
Solos
.
getCurrentUser
(
context
.
getRequest
(),
context
.
getResponse
());
...
@@ -399,8 +393,6 @@ public class ArticleConsole {
...
@@ -399,8 +393,6 @@ public class ArticleConsole {
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
renderer
.
setJSONObject
(
ret
);
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
if
(!
Solos
.
isAdminLoggedIn
(
context
))
{
if
(!
Solos
.
isAdminLoggedIn
(
context
))
{
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"forbiddenLabel"
));
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"forbiddenLabel"
));
ret
.
put
(
Keys
.
STATUS_CODE
,
false
);
ret
.
put
(
Keys
.
STATUS_CODE
,
false
);
...
@@ -442,8 +434,6 @@ public class ArticleConsole {
...
@@ -442,8 +434,6 @@ public class ArticleConsole {
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
renderer
.
setJSONObject
(
ret
);
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
if
(!
Solos
.
isAdminLoggedIn
(
context
))
{
if
(!
Solos
.
isAdminLoggedIn
(
context
))
{
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"forbiddenLabel"
));
ret
.
put
(
Keys
.
MSG
,
langPropsService
.
get
(
"forbiddenLabel"
));
ret
.
put
(
Keys
.
STATUS_CODE
,
false
);
ret
.
put
(
Keys
.
STATUS_CODE
,
false
);
...
@@ -504,8 +494,6 @@ public class ArticleConsole {
...
@@ -504,8 +494,6 @@ public class ArticleConsole {
final
JsonRenderer
renderer
=
new
JsonRenderer
();
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
try
{
try
{
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
final
JSONObject
article
=
requestJSONObject
.
getJSONObject
(
Article
.
ARTICLE
);
final
JSONObject
article
=
requestJSONObject
.
getJSONObject
(
Article
.
ARTICLE
);
...
@@ -571,8 +559,6 @@ public class ArticleConsole {
...
@@ -571,8 +559,6 @@ public class ArticleConsole {
final
JsonRenderer
renderer
=
new
JsonRenderer
();
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
ret
=
new
JSONObject
();
final
HttpServletRequest
request
=
context
.
getRequest
();
final
HttpServletResponse
response
=
context
.
getResponse
();
try
{
try
{
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
final
JSONObject
currentUser
=
Solos
.
getCurrentUser
(
context
.
getRequest
(),
context
.
getResponse
());
final
JSONObject
currentUser
=
Solos
.
getCurrentUser
(
context
.
getRequest
(),
context
.
getResponse
());
...
...
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