Commit 4989ea7a authored by 张辰's avatar 张辰

正文 评论内容不能为空

parent b232bc7b
......@@ -53,6 +53,9 @@ public class CommentManager {
// 发表评论(对主题)
public void comment(CreateCommentReq req, String userId) {
if (StringUtils.isEmpty(req.getComment())) {
throw new IllegalArgumentException("评论内容不能为空");
}
if (req.getComment().length()>500){
throw new IllegalArgumentException("评论内容不能超过500字");
}
......
......@@ -160,6 +160,10 @@ public class ThemeManager {
*/
@Transactional
public CreateThemeResp publishTheme(CreateThemeReq req, String userId) {
if (CollectionUtils.isEmpty(req.getContent())) {
throw new BizException("正文内容不能为空");
}
// 保存主题表
ThemeEntity themeEntity = new ThemeEntity();
BeanUtils.copyProperties(req, themeEntity);
......
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