Commit 31c0fb51 authored by Liang Ding's avatar Liang Ding

🎨 发布文章可指定评论计数

parent 9933c394
......@@ -52,7 +52,7 @@ import static org.b3log.solo.model.Article.*;
* Article management service.
*
* @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.1.1, Apr 18, 2019
* @version 1.3.1.2, Apr 19, 2019
* @since 0.3.5
*/
@Service
......@@ -493,6 +493,7 @@ public class ArticleMgmtService {
* "postToCommunity": boolean, // optional
* "articleSignId": "" // optional, default is "0",
* "articleCommentable": boolean,
* "articleCommentCount": int, // optional, default is 0
* "articleViewPwd": "",
* "oId": "" // optional, generate it if not exists this key
* }
......@@ -520,7 +521,7 @@ public class ArticleMgmtService {
final String[] tagTitles = tagsString.split(",");
final JSONArray tags = tag(tagTitles, article);
article.put(Article.ARTICLE_COMMENT_COUNT, 0);
article.put(Article.ARTICLE_COMMENT_COUNT, article.optInt(Article.ARTICLE_COMMENT_COUNT));
article.put(Article.ARTICLE_VIEW_COUNT, 0);
if (!article.has(Article.ARTICLE_CREATED)) {
article.put(Article.ARTICLE_CREATED, System.currentTimeMillis());
......
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