Commit 4c16e7b5 authored by Liang Ding's avatar Liang Ding

升级 Latke

parent 9e68a261
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment