aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api/v1/users.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/users.go')
-rw-r--r--routers/api/v1/users.go12
1 files changed, 4 insertions, 8 deletions
diff --git a/routers/api/v1/users.go b/routers/api/v1/users.go
index 50b213eda2..e0f51ca847 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(),
}