|
@@ -149,7 +149,7 @@ public class CommunityArticleController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation("文章评价")
|
|
|
+ @ApiOperation("文章评论")
|
|
|
@PostMapping("/comment")
|
|
|
@Transactional
|
|
|
public AjaxResult comment(@RequestBody CommunityArticleComment communityArticleComment) throws ParseException {
|
|
@@ -157,11 +157,14 @@ public class CommunityArticleController extends BaseController {
|
|
|
return AjaxResult.error("文章不存在或异常!");
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ //调用方法去判断当前评论的用户 是不是文章作者的关注列表
|
|
|
Boolean aBoolean = communityArticleService.checkCommentPermission(communityArticleComment);
|
|
|
communityArticleComment.setUserId(SecurityUtils.getUserId());
|
|
|
- /*if (!aBoolean) { // 当 aBoolean 为 false 时,进入这个条件
|
|
|
+ if (!aBoolean) { // 当 aBoolean 为 false 时,进入这个条件
|
|
|
return AjaxResult.success("您没有权限评论此文章,因为只允许关注的人评论您!");
|
|
|
- }*/
|
|
|
+ }
|
|
|
//新增评论
|
|
|
communityArticleService.sendComment(communityArticleComment);
|
|
|
return AjaxResult.success();
|