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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user