Skip to content

Commit

Permalink
🦄 fix otale#166
Browse files Browse the repository at this point in the history
  • Loading branch information
hellokaton committed Mar 23, 2017
1 parent eae4e1c commit 93f9f13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/tale/init/TaleConst.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TaleConst {
/**
* 文章最多可以输入的文字数
*/
public static final int MAX_TEXT_COUNT = 50000;
public static final int MAX_TEXT_COUNT = 200000;

/**
* 文章标题最多可以输入的文字个数
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/tale/service/impl/ContentsServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public Integer publish(Contents contents) {
if (StringKit.isBlank(contents.getContent()))
throw new TipException("文章内容不能为空");
// 最多可以输入5w个字
if (contents.getContent().length() > TaleConst.MAX_TEXT_COUNT)
int len = contents.getContent().length();
if (len > TaleConst.MAX_TEXT_COUNT)
throw new TipException("文章内容最多可以输入"+ TaleConst.MAX_TEXT_COUNT +"个字符");
if (null == contents.getAuthor_id())
throw new TipException("请登录后发布文章");
Expand Down

0 comments on commit 93f9f13

Please sign in to comment.