diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-14 17:11:30 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-14 17:11:30 -0500 |
commit | 52d66ba6c8b44b4aa28bdc2cd50acba9e22b3e66 (patch) | |
tree | a556e4e5241ccf86787097c5f4cb8767fcf06830 /routers/api/v1/users.go | |
parent | 437dd5272f557ffa3367a70230feeb1aa448b0e4 (diff) |
#12, use go-gogs-client
Diffstat (limited to 'routers/api/v1/users.go')
-rw-r--r-- | routers/api/v1/users.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/routers/api/v1/users.go b/routers/api/v1/users.go index 50b213ed..e0f51ca8 100644 --- a/routers/api/v1/users.go +++ b/routers/api/v1/users.go @@ -7,16 +7,12 @@ package v1 import ( "github.com/Unknwon/com" + api "github.com/gogits/go-gogs-client" + "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/middleware" ) -type ApiUser struct { - Id int64 `json:"id"` - UserName string `json:"username"` - AvatarUrl string `json:"avatar_url"` -} - func SearchUsers(ctx *middleware.Context) { opt := models.SearchOption{ Keyword: ctx.Query("q"), @@ -35,9 +31,9 @@ func SearchUsers(ctx *middleware.Context) { return } - results := make([]*ApiUser, len(us)) + results := make([]*api.User, len(us)) for i := range us { - results[i] = &ApiUser{ + results[i] = &api.User{ UserName: us[i].Name, AvatarUrl: us[i].AvatarLink(), } |