(ctx context.Context, username string)
| 97 | } |
| 98 | |
| 99 | func (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 | |
| 109 | func (us *UserCommon) BatchGetUserBasicInfoByUserNames(ctx context.Context, usernames []string) (map[string]*schema.UserBasicInfo, error) { |
| 110 | infomap := make(map[string]*schema.UserBasicInfo) |
no test coverage detected