(ctx context.Context, userIDs []string)
| 934 | } |
| 935 | |
| 936 | func (us *UserService) getUserInfoMapping(ctx context.Context, userIDs []string) ( |
| 937 | userInfoMapping map[string]*entity.User, err error) { |
| 938 | userInfoMapping = make(map[string]*entity.User, 0) |
| 939 | if len(userIDs) == 0 { |
| 940 | return userInfoMapping, nil |
| 941 | } |
| 942 | userInfoList, err := us.userRepo.BatchGetByID(ctx, userIDs) |
| 943 | if err != nil { |
| 944 | return nil, err |
| 945 | } |
| 946 | avatarMapping := us.siteInfoService.FormatListAvatar(ctx, userInfoList) |
| 947 | for _, user := range userInfoList { |
| 948 | user.Avatar = avatarMapping[user.ID].GetURL() |
| 949 | userInfoMapping[user.ID] = user |
| 950 | } |
| 951 | return userInfoMapping, nil |
| 952 | } |
| 953 | |
| 954 | func (us *UserService) SearchUserListByName(ctx context.Context, req *schema.GetOtherUserInfoByUsernameReq) ( |
| 955 | resp []*schema.UserBasicInfo, err error) { |
no test coverage detected