Skip to content

Commit d91e3c2

Browse files
sy-recordsshuashuai
authored andcommitted
fix: get user info error
1 parent 15cbfa8 commit d91e3c2

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

internal/service/question_common/question.go

-1
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,6 @@ func (qs *QuestionCommon) FormatQuestionsPage(
457457
item.Operator.Status = userInfo.Status
458458
}
459459
}
460-
461460
}
462461
return formattedQuestions, nil
463462
}

internal/service/user_common/user.go

+9
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,15 @@ func (us *UserCommon) BatchUserBasicInfoByID(ctx context.Context, userIDs []stri
155155
info.Avatar = avatarMapping[user.ID].GetURL()
156156
userMap[user.ID] = info
157157
}
158+
for _, id := range userIDs {
159+
if _, ok := userMap[id]; !ok {
160+
userMap[id] = &schema.UserBasicInfo{
161+
ID: id,
162+
DisplayName: "user" + converter.DeleteUserDisplay(id),
163+
Status: constant.UserDeleted,
164+
}
165+
}
166+
}
158167
return userMap, nil
159168
}
160169

0 commit comments

Comments
 (0)