Chore: Move swagger definitions to the handlers (#52643)

This commit is contained in:
Sofia Papagiannaki
2022-07-27 16:54:37 +03:00
committed by GitHub
parent c968b76279
commit 7ba076de10
76 changed files with 6022 additions and 6161 deletions

View File

@@ -23,6 +23,17 @@ func ProvideUsersService(sqlStore sqlstore.Store, searchUserFilter models.Search
return &OSSService{sqlStore: sqlStore, searchUserFilter: searchUserFilter}
}
// swagger:route GET /users users searchUsers
//
// Get users.
//
// Returns all users that the authenticated user has permission to view, admin permission required.
//
// Responses:
// 200: searchUsersResponse
// 401: unauthorisedError
// 403: forbiddenError
// 500: internalServerError
func (s *OSSService) SearchUsers(c *models.ReqContext) response.Response {
query, err := s.SearchUser(c)
if err != nil {
@@ -32,6 +43,16 @@ func (s *OSSService) SearchUsers(c *models.ReqContext) response.Response {
return response.JSON(http.StatusOK, query.Result.Users)
}
// swagger:route GET /users/search users searchUsersWithPaging
//
// Get users with paging.
//
// Responses:
// 200: searchUsersResponse
// 401: unauthorisedError
// 403: forbiddenError
// 404: notFoundError
// 500: internalServerError
func (s *OSSService) SearchUsersWithPaging(c *models.ReqContext) response.Response {
query, err := s.SearchUser(c)
if err != nil {