@@ -129,6 +129,7 @@ public int addComment(String username, AddCommentRequestDTO request) {
129129
130130 // AI审核
131131 if (commentStatus == 3 && siteConfigUtil .isLlmCommentReviewEnabled ()) {
132+ log .info ("评论 {}(用户:{})进入大模型审核" , comment .getComment_id (), username );
132133 triggerLlmCommentReview (comment , article , username );
133134 } else if (commentStatus == 3 ) {
134135 sendCommentReviewNotification (comment , article , username );
@@ -375,20 +376,25 @@ private void sendCommentReviewNotification(Comment comment, Article article, Str
375376
376377 private void triggerLlmCommentReview (Comment comment , Article article , String commenterName ) {
377378 new Thread (() -> {
379+ log .info ("评论 {} 开始执行大模型审核(文章:{})" , comment .getComment_id (), article .getArticle_name ());
378380 try {
379381 String result = llmService .reviewComment (comment .getContent ());
380382 if ("PASS" .equals (result )) {
383+ log .info ("评论 {} 大模型审核通过,自动发布" , comment .getComment_id ());
381384 commentMapper .updateCommentStatus (comment .getComment_id (), 1 );
382385 sendReviewResultToAuthor (comment , true );
383386 sendCommentNotification (comment , article , commenterName );
384387 } else if ("REJECT" .equals (result )) {
388+ log .warn ("评论 {} 大模型审核不通过,标记为违规" , comment .getComment_id ());
385389 commentMapper .updateCommentStatus (comment .getComment_id (), 4 );
386390 sendReviewResultToAuthor (comment , false );
387391 } else {
392+ log .warn ("评论 {} 大模型审核异常,保持待审核状态,等待人工审核" , comment .getComment_id ());
388393 sendCommentReviewNotification (comment , article , commenterName );
389394 }
390395 } catch (Exception e ) {
391- log .warn ("LLM评论审核异常: {}" , e .getMessage ());
396+ log .error ("评论 {} 大模型审核发生未预期异常,保持待审核状态,等待人工审核" , comment .getComment_id (), e );
397+ sendCommentReviewNotification (comment , article , commenterName );
392398 }
393399 }).start ();
394400 }
0 commit comments