diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/context/api.go | 2 | ||||
-rw-r--r-- | modules/context/api_org.go | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/modules/context/api.go b/modules/context/api.go index 8d036be9c0..770daa3ad3 100644 --- a/modules/context/api.go +++ b/modules/context/api.go @@ -18,6 +18,7 @@ import ( type APIContext struct { *Context + Org *APIOrganization } // Error responses error message to client with given message. @@ -40,6 +41,7 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) { }) } +// SetLinkHeader sets pagination link header by given totol number and page size. func (ctx *APIContext) SetLinkHeader(total, pageSize int) { page := paginater.New(total, pageSize, ctx.QueryInt("page"), 0) links := make([]string, 0, 4) diff --git a/modules/context/api_org.go b/modules/context/api_org.go new file mode 100644 index 0000000000..ecf60a1905 --- /dev/null +++ b/modules/context/api_org.go @@ -0,0 +1,14 @@ +// Copyright 2016 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 context + +import ( + "github.com/gogits/gogs/models" +) + +type APIOrganization struct { + Organization *models.User + Team *models.Team +} |