diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-11-13 02:32:18 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-11-13 02:32:18 -0500 |
commit | 8eb5120fbd19dac1221f82d84c339b4be9b0975b (patch) | |
tree | 3238704d9968d41f3f871adda4c280e3bd73685d /routers/api/v1/users.go | |
parent | 8c9338a5377c60c84cdee1f5781b3de5933bb3b0 (diff) |
#12, API: list user repos, list repo hooks
Diffstat (limited to 'routers/api/v1/users.go')
-rw-r--r-- | routers/api/v1/users.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/routers/api/v1/users.go b/routers/api/v1/users.go index 062c3680..50b213ed 100644 --- a/routers/api/v1/users.go +++ b/routers/api/v1/users.go @@ -11,9 +11,10 @@ import ( "github.com/gogits/gogs/modules/middleware" ) -type user struct { - UserName string `json:"username"` - AvatarLink string `json:"avatar"` +type ApiUser struct { + Id int64 `json:"id"` + UserName string `json:"username"` + AvatarUrl string `json:"avatar_url"` } func SearchUsers(ctx *middleware.Context) { @@ -34,11 +35,11 @@ func SearchUsers(ctx *middleware.Context) { return } - results := make([]*user, len(us)) + results := make([]*ApiUser, len(us)) for i := range us { - results[i] = &user{ - UserName: us[i].Name, - AvatarLink: us[i].AvatarLink(), + results[i] = &ApiUser{ + UserName: us[i].Name, + AvatarUrl: us[i].AvatarLink(), } } |