26 lines
832 B
Go
26 lines
832 B
Go
// Copyright 2015 The Gogs Authors. All rights reserved.
|
|
// Use of this source code is governed by a MIT-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package convert
|
|
|
|
import (
|
|
"code.gitea.io/gitea/models"
|
|
api "code.gitea.io/gitea/modules/structs"
|
|
)
|
|
|
|
// ToOrganization convert models.User to api.Organization
|
|
func ToOrganizationExt(org *models.User) *api.OrganizationExt {
|
|
return &api.OrganizationExt{
|
|
ID: org.ID,
|
|
AvatarURL: org.AvatarLink(),
|
|
UserName: org.Name,
|
|
FullName: org.FullName,
|
|
Description: org.Description,
|
|
Website: org.Website,
|
|
Location: org.Location,
|
|
Visibility: org.Visibility.String(),
|
|
RepoAdminChangeTeamAccess: org.RepoAdminChangeTeamAccess,
|
|
}
|
|
}
|