소스 검색

优化代码

fangqing 5 달 전
부모
커밋
138f4375b8
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityCommentController.java

+ 7 - 2
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityCommentController.java

@@ -327,8 +327,13 @@ public class CommunityCommentController extends BaseController {
         if (Objects.isNull(articleId)) {
             return AjaxResult.error("参数异常!");
         }
-        List<CommunityArticleComment> communityArticleComments = communityArticleCommentMapper.queryComment(articleId, comment);
-
+        List<CommunityArticleComment> communityArticleComments = null;
+        try {
+            communityArticleComments = communityArticleCommentMapper.queryComment(articleId, comment);
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            throw new ProjectException();
+        }
         return AjaxResult.success(communityArticleComments);
     }