MCPcopy
hub / github.com/apache/answer / GetUserBasicInfoByUserName

Method GetUserBasicInfoByUserName

internal/service/user_common/user.go:99–107  ·  view source on GitHub ↗
(ctx context.Context, username string)

Source from the content-addressed store, hash-verified

97}
98
99func (us *UserCommon) GetUserBasicInfoByUserName(ctx context.Context, username string) (*schema.UserBasicInfo, bool, error) {
100 userInfo, exist, err := us.userRepo.GetByUsername(ctx, username)
101 if err != nil {
102 return nil, exist, err
103 }
104 info := us.FormatUserBasicInfo(ctx, userInfo)
105 info.Avatar = us.siteInfoCommonService.FormatAvatar(ctx, userInfo.Avatar, userInfo.EMail, userInfo.Status).GetURL()
106 return info, exist, nil
107}
108
109func (us *UserCommon) BatchGetUserBasicInfoByUserNames(ctx context.Context, usernames []string) (map[string]*schema.UserBasicInfo, error) {
110 infomap := make(map[string]*schema.UserBasicInfo)

Callers 11

MCPUserDetailsHandlerMethod · 0.80
parseUserIDMethod · 0.80
GetRankPersonalPageMethod · 0.80
notificationMentionMethod · 0.80
PersonalQuestionPageMethod · 0.80
PersonalAnswerPageMethod · 0.80
SearchUserTopListMethod · 0.80
GetQuestionPageMethod · 0.80
notificationMentionMethod · 0.80

Calls 4

FormatUserBasicInfoMethod · 0.95
GetURLMethod · 0.80
GetByUsernameMethod · 0.65
FormatAvatarMethod · 0.65

Tested by

no test coverage detected