GetUsers returns all the users swagger:operation GET /user user getUsers Return all users. --- produces: [application/json] security: [clientTokenAuthorizationHeader: [], clientTokenHeader: [], clientTokenQuery: [], basicAuth: []] responses: 200: description: Ok schema: typ
(ctx *gin.Context)
| 88 | // schema: |
| 89 | // $ref: "#/definitions/Error" |
| 90 | func (a *UserAPI) GetUsers(ctx *gin.Context) { |
| 91 | users, err := a.DB.GetUsers() |
| 92 | if success := successOrAbort(ctx, 500, err); !success { |
| 93 | return |
| 94 | } |
| 95 | var resp []*model.UserExternal |
| 96 | for _, user := range users { |
| 97 | resp = append(resp, toExternalUser(user)) |
| 98 | } |
| 99 | |
| 100 | ctx.JSON(200, resp) |
| 101 | } |
| 102 | |
| 103 | // GetCurrentUser returns the current user |
| 104 | // swagger:operation GET /current/user user currentUser |
nothing calls this directly
no test coverage detected