|
|
@ -34,11 +34,15 @@ func Search(ctx *context.APIContext) { |
|
|
|
// type: string
|
|
|
|
// type: string
|
|
|
|
// - name: uid
|
|
|
|
// - name: uid
|
|
|
|
// in: query
|
|
|
|
// in: query
|
|
|
|
// description: if provided, will return only repos owned by the user with the given id
|
|
|
|
// description: search only for repos that the user with the given id owns or contributes to
|
|
|
|
|
|
|
|
// type: integer
|
|
|
|
|
|
|
|
// - name: page
|
|
|
|
|
|
|
|
// in: query
|
|
|
|
|
|
|
|
// description: page number of results to return (1-based)
|
|
|
|
// type: integer
|
|
|
|
// type: integer
|
|
|
|
// - name: limit
|
|
|
|
// - name: limit
|
|
|
|
// in: query
|
|
|
|
// in: query
|
|
|
|
// description: maximum number of repos to return
|
|
|
|
// description: page size of results, maximum page size is 50
|
|
|
|
// type: integer
|
|
|
|
// type: integer
|
|
|
|
// - name: mode
|
|
|
|
// - name: mode
|
|
|
|
// in: query
|
|
|
|
// in: query
|
|
|
@ -47,7 +51,7 @@ func Search(ctx *context.APIContext) { |
|
|
|
// type: string
|
|
|
|
// type: string
|
|
|
|
// - name: exclusive
|
|
|
|
// - name: exclusive
|
|
|
|
// in: query
|
|
|
|
// in: query
|
|
|
|
// description: only search for repositories owned by the authenticated user
|
|
|
|
// description: if `uid` is given, search only for repos that the user owns
|
|
|
|
// type: boolean
|
|
|
|
// type: boolean
|
|
|
|
// responses:
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "200":
|
|
|
@ -57,6 +61,7 @@ func Search(ctx *context.APIContext) { |
|
|
|
opts := &models.SearchRepoOptions{ |
|
|
|
opts := &models.SearchRepoOptions{ |
|
|
|
Keyword: strings.Trim(ctx.Query("q"), " "), |
|
|
|
Keyword: strings.Trim(ctx.Query("q"), " "), |
|
|
|
OwnerID: ctx.QueryInt64("uid"), |
|
|
|
OwnerID: ctx.QueryInt64("uid"), |
|
|
|
|
|
|
|
Page: ctx.QueryInt("page"), |
|
|
|
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")), |
|
|
|
PageSize: convert.ToCorrectPageSize(ctx.QueryInt("limit")), |
|
|
|
Collaborate: util.OptionalBoolNone, |
|
|
|
Collaborate: util.OptionalBoolNone, |
|
|
|
} |
|
|
|
} |
|
|
|