Clean backend debug logging and standardize error reporting.

This removes verbose trace output in handlers/services and keeps only actionable error-level logs.
This commit is contained in:
2026-03-09 22:18:53 +08:00
parent 4d8f2ec997
commit 4c0177149a
13 changed files with 8 additions and 163 deletions

View File

@@ -2,7 +2,6 @@ package repository
import (
"carrot_bbs/internal/model"
"fmt"
"gorm.io/gorm"
"gorm.io/gorm/clause"
@@ -362,8 +361,6 @@ func (r *UserRepository) GetMutualFollowStatus(currentUserID string, targetUserI
return result, nil
}
fmt.Printf("[DEBUG] GetMutualFollowStatus: currentUserID=%s, targetUserIDs=%v\n", currentUserID, targetUserIDs)
// 初始化所有目标用户为未关注状态
for _, userID := range targetUserIDs {
result[userID] = [2]bool{false, false}
@@ -377,7 +374,6 @@ func (r *UserRepository) GetMutualFollowStatus(currentUserID string, targetUserI
if err != nil {
return nil, err
}
fmt.Printf("[DEBUG] GetMutualFollowStatus: currentUser follows these targets: %v\n", followingIDs)
for _, id := range followingIDs {
status := result[id]
status[0] = true
@@ -392,13 +388,11 @@ func (r *UserRepository) GetMutualFollowStatus(currentUserID string, targetUserI
if err != nil {
return nil, err
}
fmt.Printf("[DEBUG] GetMutualFollowStatus: these targets follow currentUser: %v\n", followerIDs)
for _, id := range followerIDs {
status := result[id]
status[1] = true
result[id] = status
}
fmt.Printf("[DEBUG] GetMutualFollowStatus: final result=%v\n", result)
return result, nil
}