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
4c16e7b5
Unverified
Commit
4c16e7b5
authored
Dec 07, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
⬆
升级 Latke
parent
9e68a261
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
45 deletions
+58
-45
src/main/java/org/b3log/solo/processor/api/B3ArticleReceiver.java
.../java/org/b3log/solo/processor/api/B3ArticleReceiver.java
+36
-26
src/main/java/org/b3log/solo/processor/api/B3CommentReceiver.java
.../java/org/b3log/solo/processor/api/B3CommentReceiver.java
+22
-19
No files found.
src/main/java/org/b3log/solo/processor/api/B3ArticleReceiver.java
View file @
4c16e7b5
...
...
@@ -78,6 +78,21 @@ public class B3ArticleReceiver {
/**
* Adds an article with the specified request.
* <p>
* Request json:
* <pre>
* {
* "article": {
* "oId": "",
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* }
* </pre>
* </p>
* <p>
* Renders the response with a json object, for example,
* <pre>
* {
...
...
@@ -88,24 +103,14 @@ public class B3ArticleReceiver {
* </pre>
* </p>
*
* @param context the specified http request context
* @param requestJSONObject the specified http servlet request, for example,
* "article": {
* "oId": "",
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* @throws Exception exception
* @param context the specified http request context
*/
@RequestProcessing
(
value
=
"/apis/symphony/article"
,
method
=
HttpMethod
.
POST
)
public
void
addArticle
(
final
RequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
public
void
addArticle
(
final
RequestContext
context
)
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
try
{
final
JSONObject
article
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
...
...
@@ -151,6 +156,21 @@ public class B3ArticleReceiver {
/**
* Updates an article with the specified request.
* <p>
* Request json:
* <pre>
* {
* "article": {
* "oId": "", // Symphony Article#clientArticleId
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* }
* </pre>
* </p>
* <p>
* Renders the response with a json object, for example,
* <pre>
* {
...
...
@@ -160,25 +180,15 @@ public class B3ArticleReceiver {
* </pre>
* </p>
*
* @param context the specified http request context
* @param requestJSONObject the specified http servlet request, for example,
* "article": {
* "oId": "", // Symphony Article#clientArticleId
* "articleTitle": "",
* "articleContent": "",
* "articleTags": "tag1,tag2,tag3",
* "userB3Key": "",
* "articleEditorType": ""
* }
* @throws Exception exception
* @param context the specified http request context
*/
@RequestProcessing
(
value
=
"/apis/symphony/article"
,
method
=
HttpMethod
.
PUT
)
public
void
updateArticle
(
final
RequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
public
void
updateArticle
(
final
RequestContext
context
)
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
try
{
final
JSONObject
article
=
requestJSONObject
.
optJSONObject
(
Article
.
ARTICLE
);
...
...
src/main/java/org/b3log/solo/processor/api/B3CommentReceiver.java
View file @
4c16e7b5
...
...
@@ -108,6 +108,25 @@ public class B3CommentReceiver {
/**
* Adds a comment with the specified request.
* <p>
* Request json:
* <pre>
* {
* "comment": {
* "userB3Key": "",
* "oId": "",
* "commentSymphonyArticleId": "",
* "commentOnArticleId": "",
* "commentAuthorName": "",
* "commentAuthorEmail": "",
* "commentAuthorURL": "",
* "commentAuthorThumbnailURL": "",
* "commentContent": "",
* "commentOriginalCommentId": "" // optional, if exists this key, the comment is an reply
* }
* }
* </pre>
* </p>
* <p>
* Renders the response with a json object, for example,
* <pre>
* {
...
...
@@ -116,32 +135,16 @@ public class B3CommentReceiver {
* </pre>
* </p>
*
* @param context the specified http request context
* @param requestJSONObject the specified http servlet request, for example,
* {
* "comment": {
* "userB3Key": "",
* "oId": "",
* "commentSymphonyArticleId": "",
* "commentOnArticleId": "",
* "commentAuthorName": "",
* "commentAuthorEmail": "",
* "commentAuthorURL": "",
* "commentAuthorThumbnailURL": "",
* "commentContent": "",
* "commentOriginalCommentId": "" // optional, if exists this key, the comment is an reply
* }
* }
* @throws Exception exception
* @param context the specified http request context
*/
@RequestProcessing
(
value
=
"/apis/symphony/comment"
,
method
=
HttpMethod
.
PUT
)
public
void
addComment
(
final
RequestContext
context
,
final
JSONObject
requestJSONObject
)
throws
Exception
{
public
void
addComment
(
final
RequestContext
context
)
{
final
JsonRenderer
renderer
=
new
JsonRenderer
();
context
.
setRenderer
(
renderer
);
final
JSONObject
ret
=
new
JSONObject
();
renderer
.
setJSONObject
(
ret
);
final
JSONObject
requestJSONObject
=
context
.
requestJSON
();
final
Transaction
transaction
=
commentRepository
.
beginTransaction
();
try
{
final
JSONObject
symphonyCmt
=
requestJSONObject
.
optJSONObject
(
Comment
.
COMMENT
);
...
...
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