1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

golint fixed for routers (#208)

This commit is contained in:
Lunny Xiao
2016-11-24 15:04:31 +08:00
committed by GitHub
parent 3a3782bb7f
commit 3917ed45de
35 changed files with 354 additions and 155 deletions

View File

@@ -26,12 +26,14 @@ func listUserOrgs(ctx *context.APIContext, u *models.User, all bool) {
ctx.JSON(200, &apiOrgs)
}
// https://github.com/gogits/go-gogs-client/wiki/Organizations#list-your-organizations
// ListMyOrgs list all my orgs
// see https://github.com/gogits/go-gogs-client/wiki/Organizations#list-your-organizations
func ListMyOrgs(ctx *context.APIContext) {
listUserOrgs(ctx, ctx.User, true)
}
// https://github.com/gogits/go-gogs-client/wiki/Organizations#list-user-organizations
// ListUserOrgs list user's orgs
// see https://github.com/gogits/go-gogs-client/wiki/Organizations#list-user-organizations
func ListUserOrgs(ctx *context.APIContext) {
u := user.GetUserByParams(ctx)
if ctx.Written() {
@@ -40,12 +42,14 @@ func ListUserOrgs(ctx *context.APIContext) {
listUserOrgs(ctx, u, false)
}
// https://github.com/gogits/go-gogs-client/wiki/Organizations#get-an-organization
// Get get an organization
// see https://github.com/gogits/go-gogs-client/wiki/Organizations#get-an-organization
func Get(ctx *context.APIContext) {
ctx.JSON(200, convert.ToOrganization(ctx.Org.Organization))
}
// https://github.com/gogits/go-gogs-client/wiki/Organizations#edit-an-organization
// Edit change an organization's information
// see https://github.com/gogits/go-gogs-client/wiki/Organizations#edit-an-organization
func Edit(ctx *context.APIContext, form api.EditOrgOption) {
org := ctx.Org.Organization
if !org.IsOwnedBy(ctx.User.ID) {

View File

@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/routers/api/v1/convert"
)
// ListTeams list all the teams of an organization
func ListTeams(ctx *context.APIContext) {
org := ctx.Org.Organization
if err := org.GetTeams(); err != nil {