// ToApiUser converts user to API format. func ToApiUser(u *models.User) *api.User { return &api.User{ Id: u.Id, UserName: u.Name, AvatarUrl: string(setting.Protocol) + u.AvatarLink(), } }
// ToApiUser converts user to API format. func ToApiUser(u *models.User) *api.User { return &api.User{ ID: u.Id, UserName: u.Name, FullName: u.FullName, Email: u.Email, AvatarUrl: u.AvatarLink(), } }
func ToOrganization(org *models.User) *api.Organization { return &api.Organization{ ID: org.ID, AvatarUrl: org.AvatarLink(), UserName: org.Name, FullName: org.FullName, Description: org.Description, Website: org.Website, Location: org.Location, } }
func ToUser(u *models.User) *api.User { if u == nil { return nil } return &api.User{ ID: u.ID, UserName: u.Name, FullName: u.FullName, Email: u.Email, AvatarUrl: u.AvatarLink(), } }