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
32cef8b2
Commit
32cef8b2
authored
Mar 03, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
#12401
parent
ba23e796
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
109 deletions
+109
-109
pom.xml
pom.xml
+2
-2
src/main/java/org/b3log/solo/processor/console/PageConsole.java
...in/java/org/b3log/solo/processor/console/PageConsole.java
+48
-47
src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java
...a/org/b3log/solo/processor/console/PreferenceConsole.java
+59
-60
No files found.
pom.xml
View file @
32cef8b2
<?xml version="1.0" encoding="UTF-8"?>
<!--
Description: Solo POM.
Version: 3.18.2.5
4, Feb 1
3, 2018
Version: 3.18.2.5
5, Mar
3, 2018
Author: <a href="http://88250.b3log.org">Liang Ding</a>
Author: <a href="http://www.annpeter.cn">Ann Peter</a>
Author: <a href="http://vanessa.b3log.org">Vanessa</a>
...
...
@@ -76,7 +76,7 @@
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<org.b3log.latke.version>
2.3.1
7
</org.b3log.latke.version>
<org.b3log.latke.version>
2.3.1
9
</org.b3log.latke.version>
<servlet.version>
3.1.0
</servlet.version>
<slf4j.version>
1.7.5
</slf4j.version>
...
...
src/main/java/org/b3log/solo/processor/console/PageConsole.java
View file @
32cef8b2
...
...
@@ -44,7 +44,7 @@ import javax.servlet.http.HttpServletResponse;
* Plugin console request processing.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.0.
3, Sep 21, 2017
* @version 1.0.0.
4, Mar 3, 2018
* @since 0.4.0
*/
@RequestProcessor
...
...
@@ -91,27 +91,29 @@ public class PageConsole {
* </pre>
* </p>
*
* @param request the specified http servlet request, for example,
* {
* "page": {
* "oId": "",
* "pageTitle": "",
* "pageContent": "",
* "pageOrder": int,
* "pageCommentCount": int,
* "pagePermalink": "",
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "page": {
* "oId": "",
* "pageTitle": "",
* "pageContent": "",
* "pageOrder": int,
* "pageCommentCount": int,
* "pagePermalink": "",
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified reuqest json object
* @throws Exception exception
*/
@RequestProcessing
(
value
=
"/console/page/"
,
method
=
HTTPRequestMethod
.
PUT
)
public
void
updatePage
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
)
public
void
updatePage
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
if
(!
userQueryService
.
isAdminLoggedIn
(
request
))
{
response
.
sendError
(
HttpServletResponse
.
SC_FORBIDDEN
);
...
...
@@ -125,8 +127,6 @@ public class PageConsole {
final
JSONObject
ret
=
new
JSONObject
();
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
pageMgmtService
.
updatePage
(
requestJSONObject
);
ret
.
put
(
Keys
.
STATUS_CODE
,
true
);
...
...
@@ -203,24 +203,26 @@ public class PageConsole {
* </pre>
* </p>
*
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "page": {
* "pageTitle": "",
* "pageContent": "",
* "pagePermalink": "" // optional,
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "page": {
* "pageTitle": "",
* "pageContent": "",
* "pagePermalink": "" // optional,
* "pageCommentable": boolean,
* "pageType": "",
* "pageOpenTarget": "",
* "pageIcon": ""
* }
* }, see {@link org.b3log.solo.model.Page} for more details
* @param response the specified http servlet response
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing
(
value
=
"/console/page/"
,
method
=
HTTPRequestMethod
.
POST
)
public
void
addPage
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
)
public
void
addPage
(
final
HTTPRequestContext
context
,
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
if
(!
userQueryService
.
isAdminLoggedIn
(
request
))
{
response
.
sendError
(
HttpServletResponse
.
SC_FORBIDDEN
);
...
...
@@ -234,8 +236,6 @@ public class PageConsole {
final
JSONObject
ret
=
new
JSONObject
();
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
final
String
pageId
=
pageMgmtService
.
addPage
(
requestJSONObject
);
ret
.
put
(
Keys
.
OBJECT_ID
,
pageId
);
...
...
@@ -265,17 +265,19 @@ public class PageConsole {
* </pre>
* </p>
*
* @param request the specified http servlet request, for example,
* {
* "oId": "",
* "direction": "" // "up"/"down"
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* {
* "oId": "",
* "direction": "" // "up"/"down"
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing
(
value
=
"/console/page/order/"
,
method
=
HTTPRequestMethod
.
PUT
)
public
void
changeOrder
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
)
public
void
changeOrder
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
if
(!
userQueryService
.
isAdminLoggedIn
(
request
))
{
response
.
sendError
(
HttpServletResponse
.
SC_FORBIDDEN
);
...
...
@@ -289,7 +291,6 @@ public class PageConsole {
final
JSONObject
ret
=
new
JSONObject
();
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
final
String
linkId
=
requestJSONObject
.
getString
(
Keys
.
OBJECT_ID
);
final
String
direction
=
requestJSONObject
.
getString
(
Common
.
DIRECTION
);
...
...
src/main/java/org/b3log/solo/processor/console/PreferenceConsole.java
View file @
32cef8b2
...
...
@@ -27,7 +27,6 @@ import org.b3log.latke.servlet.HTTPRequestMethod;
import
org.b3log.latke.servlet.annotation.RequestProcessing
;
import
org.b3log.latke.servlet.annotation.RequestProcessor
;
import
org.b3log.latke.servlet.renderer.JSONRenderer
;
import
org.b3log.latke.util.Requests
;
import
org.b3log.solo.model.Option
;
import
org.b3log.solo.model.Sign
;
import
org.b3log.solo.model.Skin
;
...
...
@@ -44,7 +43,7 @@ import javax.servlet.http.HttpServletResponse;
* Preference console request processing.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.2.0.1
0, May 2, 2017
* @version 1.2.0.1
1, May 2, 2018
* @since 0.4.0
*/
@RequestProcessor
...
...
@@ -148,19 +147,21 @@ public class PreferenceConsole {
/**
* Updates reply template.
*
* @param request the specified http servlet request, for example,
* "replyNotificationTemplate": {
* "subject": "",
* "body": ""
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* "replyNotificationTemplate": {
* "subject": "",
* "body": ""
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing
(
value
=
"/console/reply/notification/template"
,
method
=
HTTPRequestMethod
.
PUT
)
public
void
updateReplyNotificationTemplate
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
)
throws
Exception
{
final
HTTPRequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
if
(!
userQueryService
.
isLoggedIn
(
request
,
response
))
{
response
.
sendError
(
HttpServletResponse
.
SC_FORBIDDEN
);
return
;
...
...
@@ -170,7 +171,6 @@ public class PreferenceConsole {
context
.
setRenderer
(
renderer
);
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
final
JSONObject
replyNotificationTemplate
=
requestJSONObject
.
getJSONObject
(
"replyNotificationTemplate"
);
preferenceMgmtService
.
updateReplyNotificationTemplate
(
replyNotificationTemplate
);
...
...
@@ -340,47 +340,48 @@ public class PreferenceConsole {
/**
* Updates the preference by the specified request.
*
* @param request the specified http servlet request, for example,
* "preference": {
* "mostViewArticleDisplayCount": int,
* "recentCommentDisplayCount": int,
* "mostUsedTagDisplayCount": int,
* "articleListDisplayCount": int,
* "articleListPaginationWindowSize": int,
* "mostCommentArticleDisplayCount": int,
* "externalRelevantArticlesDisplayCount": int,
* "relevantArticlesDisplayCount": int,
* "randomArticlesDisplayCount": int,
* "blogTitle": "",
* "blogSubtitle": "",
* "skinDirName": "",
* "localeString": "",
* "timeZoneId": "",
* "noticeBoard": "",
* "footerContent": "",
* "htmlHead": "",
* "metaKeywords": "",
* "metaDescription": "",
* "enableArticleUpdateHint": boolean,
* "signs": [{
* "oId": "",
* "signHTML": ""
* }, ...],
* "allowVisitDraftViaPermalink": boolean,
* "allowRegister": boolean,
* "articleListStyle": "",
* "editorType": "",
* "commentable": boolean,
* "feedOutputMode: "",
* "feedOutputCnt": int
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* "preference": {
* "mostViewArticleDisplayCount": int,
* "recentCommentDisplayCount": int,
* "mostUsedTagDisplayCount": int,
* "articleListDisplayCount": int,
* "articleListPaginationWindowSize": int,
* "mostCommentArticleDisplayCount": int,
* "externalRelevantArticlesDisplayCount": int,
* "relevantArticlesDisplayCount": int,
* "randomArticlesDisplayCount": int,
* "blogTitle": "",
* "blogSubtitle": "",
* "skinDirName": "",
* "localeString": "",
* "timeZoneId": "",
* "noticeBoard": "",
* "footerContent": "",
* "htmlHead": "",
* "metaKeywords": "",
* "metaDescription": "",
* "enableArticleUpdateHint": boolean,
* "signs": [{
* "oId": "",
* "signHTML": ""
* }, ...],
* "allowVisitDraftViaPermalink": boolean,
* "allowRegister": boolean,
* "articleListStyle": "",
* "editorType": "",
* "commentable": boolean,
* "feedOutputMode: "",
* "feedOutputCnt": int
* }
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified reuqest json object
* @throws Exception exception
*/
@RequestProcessing
(
value
=
PREFERENCE_URI_PREFIX
,
method
=
HTTPRequestMethod
.
PUT
)
public
void
updatePreference
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
)
throws
Exception
{
public
void
updatePreference
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
if
(!
userQueryService
.
isAdminLoggedIn
(
request
))
{
response
.
sendError
(
HttpServletResponse
.
SC_FORBIDDEN
);
return
;
...
...
@@ -390,7 +391,6 @@ public class PreferenceConsole {
context
.
setRenderer
(
renderer
);
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
final
JSONObject
preference
=
requestJSONObject
.
getJSONObject
(
Option
.
CATEGORY_C_PREFERENCE
);
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
...
...
@@ -472,18 +472,19 @@ public class PreferenceConsole {
/**
* Updates the Qiniu preference by the specified request.
*
* @param request the specified http servlet request, for example,
* "qiniuAccessKey": "",
* "qiniuSecretKey": "",
* "qiniuDomain": "",
* "qiniuBucket": ""
* @param response the specified http servlet response
* @param context the specified http request context
* @param request the specified http servlet request, for example,
* "qiniuAccessKey": "",
* "qiniuSecretKey": "",
* "qiniuDomain": "",
* "qiniuBucket": ""
* @param response the specified http servlet response
* @param context the specified http request context
* @param requestJSONObject the specified request json object
* @throws Exception exception
*/
@RequestProcessing
(
value
=
PREFERENCE_URI_PREFIX
+
"qiniu"
,
method
=
HTTPRequestMethod
.
PUT
)
public
void
updateQiniu
(
final
HttpServletRequest
request
,
final
HttpServletResponse
response
,
final
HTTPRequestContext
context
)
throws
Exception
{
final
HTTPRequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
if
(!
userQueryService
.
isAdminLoggedIn
(
request
))
{
response
.
sendError
(
HttpServletResponse
.
SC_FORBIDDEN
);
...
...
@@ -494,8 +495,6 @@ public class PreferenceConsole {
context
.
setRenderer
(
renderer
);
try
{
final
JSONObject
requestJSONObject
=
Requests
.
parseRequestJSONObject
(
request
,
response
);
final
String
accessKey
=
requestJSONObject
.
optString
(
Option
.
ID_C_QINIU_ACCESS_KEY
).
trim
();
final
String
secretKey
=
requestJSONObject
.
optString
(
Option
.
ID_C_QINIU_SECRET_KEY
).
trim
();
String
domain
=
requestJSONObject
.
optString
(
Option
.
ID_C_QINIU_DOMAIN
).
trim
();
...
...
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