MCPcopy Index your code
hub / github.com/apache/answer / GetUserStaff

Method GetUserStaff

internal/service/content/user_service.go:826–841  ·  view source on GitHub ↗

GetUserStaff get user staff

(ctx context.Context, req *schema.GetUserStaffReq)

Source from the content-addressed store, hash-verified

824
825// GetUserStaff get user staff
826func (us *UserService) GetUserStaff(ctx context.Context, req *schema.GetUserStaffReq) (
827 resp []*schema.GetUserStaffResp, err error) {
828 userList, err := us.userRepo.SearchUserListByName(ctx, req.Username, req.PageSize, true)
829 if err != nil {
830 return nil, err
831 }
832 avatarMapping := us.siteInfoService.FormatListAvatar(ctx, userList)
833 for _, u := range userList {
834 resp = append(resp, &schema.GetUserStaffResp{
835 Username: u.Username,
836 DisplayName: u.DisplayName,
837 Avatar: avatarMapping[u.ID].GetURL(),
838 })
839 }
840 return resp, nil
841}
842
843// UserUnsubscribeNotification user unsubscribe email notification
844func (us *UserService) UserUnsubscribeNotification(

Callers 1

UserStaffMethod · 0.80

Calls 3

GetURLMethod · 0.80
SearchUserListByNameMethod · 0.65
FormatListAvatarMethod · 0.65

Tested by

no test coverage detected