Commit 6e6c5603 authored by 张辰's avatar 张辰
parents 9f9f90f5 6bb304f9
...@@ -40,6 +40,9 @@ public class CommentService { ...@@ -40,6 +40,9 @@ public class CommentService {
@Transactional @Transactional
public void insertComment(CommentEntity commentEntity) { public void insertComment(CommentEntity commentEntity) {
commentEntity.setCommentId(uuidGenHelper.getUuidStr()); commentEntity.setCommentId(uuidGenHelper.getUuidStr());
if (commentEntity.getContent().length()>500){
throw new IllegalArgumentException("评论内容超过500字");
}
commentMapper.insert(commentEntity); commentMapper.insert(commentEntity);
//失效缓存 //失效缓存
evictThemeCache(commentEntity.getThemeId()); evictThemeCache(commentEntity.getThemeId());
......
This diff is collapsed.
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