Commit a8a55dae authored by Liang Ding's avatar Liang Ding

去除“同步自”文案

parent e7db0b76
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
package org.b3log.solo.api.symphony; package org.b3log.solo.api.symphony;
import javax.inject.Inject; import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -41,12 +40,11 @@ import org.b3log.solo.util.QueryResults; ...@@ -41,12 +40,11 @@ import org.b3log.solo.util.QueryResults;
import org.json.JSONObject; import org.json.JSONObject;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
/** /**
* Article receiver (from B3log Symphony). * Article receiver (from B3log Symphony).
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.0.1.6, Oct 1, 2015 * @version 1.0.1.7, Dec 31, 2015
* @since 0.5.5 * @since 0.5.5
*/ */
@RequestProcessor @RequestProcessor
...@@ -100,8 +98,7 @@ public class ArticleReceiver { ...@@ -100,8 +98,7 @@ public class ArticleReceiver {
* </pre> * </pre>
* </p> * </p>
* *
* @param request the specified http servlet request, for example, * @param request the specified http servlet request, for example, <pre>
* <pre>
* { * {
* "article": { * "article": {
* "oId": "", * "oId": "",
...@@ -113,13 +110,14 @@ public class ArticleReceiver { ...@@ -113,13 +110,14 @@ public class ArticleReceiver {
* } * }
* } * }
* </pre> * </pre>
*
* @param response the specified http servlet response * @param response the specified http servlet response
* @param context the specified http request context * @param context the specified http request context
* @throws Exception exception * @throws Exception exception
*/ */
@RequestProcessing(value = "/apis/symphony/article", method = HTTPRequestMethod.POST) @RequestProcessing(value = "/apis/symphony/article", method = HTTPRequestMethod.POST)
public void addArticle(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context) public void addArticle(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context)
throws Exception { throws Exception {
final JSONRenderer renderer = new JSONRenderer(); final JSONRenderer renderer = new JSONRenderer();
context.setRenderer(renderer); context.setRenderer(renderer);
...@@ -156,8 +154,8 @@ public class ArticleReceiver { ...@@ -156,8 +154,8 @@ public class ArticleReceiver {
String content = article.getString(Article.ARTICLE_CONTENT); String content = article.getString(Article.ARTICLE_CONTENT);
final String articleId = article.getString(Keys.OBJECT_ID); final String articleId = article.getString(Keys.OBJECT_ID);
content += "\n\n<p style='font-size: 12px;'><i>该文章同步自 <a href='http://hacpai.com/article/" + articleId // content += "\n\n<p style='font-size: 12px;'><i>该文章同步自 <a href='http://hacpai.com/article/" + articleId
+ "' target='_blank'>黑客派</a></i></p>"; // + "' target='_blank'>黑客派</a></i></p>";
article.put(Article.ARTICLE_CONTENT, content); article.put(Article.ARTICLE_CONTENT, content);
articleMgmtService.addArticle(requestJSONObject); articleMgmtService.addArticle(requestJSONObject);
...@@ -190,8 +188,7 @@ public class ArticleReceiver { ...@@ -190,8 +188,7 @@ public class ArticleReceiver {
* </pre> * </pre>
* </p> * </p>
* *
* @param request the specified http servlet request, for example, * @param request the specified http servlet request, for example, <pre>
* <pre>
* { * {
* "article": { * "article": {
* "oId": "", // Symphony Article#clientArticleId * "oId": "", // Symphony Article#clientArticleId
...@@ -203,13 +200,14 @@ public class ArticleReceiver { ...@@ -203,13 +200,14 @@ public class ArticleReceiver {
* } * }
* } * }
* </pre> * </pre>
*
* @param response the specified http servlet response * @param response the specified http servlet response
* @param context the specified http request context * @param context the specified http request context
* @throws Exception exception * @throws Exception exception
*/ */
@RequestProcessing(value = "/apis/symphony/article", method = HTTPRequestMethod.PUT) @RequestProcessing(value = "/apis/symphony/article", method = HTTPRequestMethod.PUT)
public void updateArticle(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context) public void updateArticle(final HttpServletRequest request, final HttpServletResponse response, final HTTPRequestContext context)
throws Exception { throws Exception {
final JSONRenderer renderer = new JSONRenderer(); final JSONRenderer renderer = new JSONRenderer();
context.setRenderer(renderer); context.setRenderer(renderer);
...@@ -253,8 +251,8 @@ public class ArticleReceiver { ...@@ -253,8 +251,8 @@ public class ArticleReceiver {
article.put(Article.ARTICLE_VIEW_PWD, ""); article.put(Article.ARTICLE_VIEW_PWD, "");
String content = article.getString(Article.ARTICLE_CONTENT); String content = article.getString(Article.ARTICLE_CONTENT);
content += "\n\n<p style='font-size: 12px;'><i>该文章同步自 <a href='http://hacpai.com/article/" + articleId // content += "\n\n<p style='font-size: 12px;'><i>该文章同步自 <a href='http://hacpai.com/article/" + articleId
+ "' target='_blank'>黑客派</a></i></p>"; // + "' target='_blank'>黑客派</a></i></p>";
article.put(Article.ARTICLE_CONTENT, content); article.put(Article.ARTICLE_CONTENT, content);
articleMgmtService.updateArticle(requestJSONObject); articleMgmtService.updateArticle(requestJSONObject);
......
...@@ -38,7 +38,6 @@ import org.b3log.latke.urlfetch.URLFetchService; ...@@ -38,7 +38,6 @@ import org.b3log.latke.urlfetch.URLFetchService;
import org.b3log.latke.urlfetch.URLFetchServiceFactory; import org.b3log.latke.urlfetch.URLFetchServiceFactory;
import org.b3log.latke.util.Requests; import org.b3log.latke.util.Requests;
import org.b3log.latke.util.Strings; import org.b3log.latke.util.Strings;
import org.b3log.solo.SoloServletListener;
import org.b3log.solo.event.EventTypes; import org.b3log.solo.event.EventTypes;
import org.b3log.solo.model.Article; import org.b3log.solo.model.Article;
import org.b3log.solo.model.Comment; import org.b3log.solo.model.Comment;
...@@ -57,7 +56,7 @@ import org.json.JSONObject; ...@@ -57,7 +56,7 @@ import org.json.JSONObject;
* Comment receiver (from B3log Symphony). * Comment receiver (from B3log Symphony).
* *
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.1.1.10, Dec 29, 2015 * @version 1.1.1.11, Dec 31, 2015
* @since 0.5.5 * @since 0.5.5
*/ */
@RequestProcessor @RequestProcessor
...@@ -201,9 +200,9 @@ public class CommentReceiver { ...@@ -201,9 +200,9 @@ public class CommentReceiver {
final String commentId = symphonyCmt.optString(Keys.OBJECT_ID); final String commentId = symphonyCmt.optString(Keys.OBJECT_ID);
String commentContent = symphonyCmt.getString(Comment.COMMENT_CONTENT); String commentContent = symphonyCmt.getString(Comment.COMMENT_CONTENT);
commentContent += "<p class='cmtFromSym'><i>该评论同步自 <a href='" + SoloServletListener.B3LOG_SYMPHONY_SERVE_PATH // commentContent += "<p class='cmtFromSym'><i>该评论同步自 <a href='" + SoloServletListener.B3LOG_SYMPHONY_SERVE_PATH
+ "/article/" + symphonyCmt.optString("commentSymphonyArticleId") + "#" + commentId // + "/article/" + symphonyCmt.optString("commentSymphonyArticleId") + "#" + commentId
+ "' target='_blank'>黑客派</a></i></p>"; // + "' target='_blank'>黑客派</a></i></p>";
final String originalCommentId = symphonyCmt.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID); final String originalCommentId = symphonyCmt.optString(Comment.COMMENT_ORIGINAL_COMMENT_ID);
// Step 1: Add comment // Step 1: Add comment
final JSONObject comment = new JSONObject(); final JSONObject comment = new JSONObject();
......
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