@Override public Response createUsersWithListInput(java.util.List<User> users) { for (User user : users) { userData.addUser(user); } return Response.ok().entity("").build(); }
@Override public Response createUsersWithArrayInput(User[] users) { for (User user : users) { userData.addUser(user); } return Response.ok().entity("").build(); }
@Override public Response deleteUser(String username) { if (userData.removeUser(username)) { return Response.ok().entity("").build(); } else { return Response.status(Response.Status.NOT_FOUND).build(); } }
@Override public Response getUserByName(String username) throws ApiException { User user = userData.findUserByName(username); if (null != user) { return Response.ok().entity(user).build(); } else { throw new NotFoundException(404, "User not found"); } }
@Override public Response updateUser(String username, User user) { userData.addUser(user); return Response.ok().entity("").build(); }
@Override public Response createUser(User user) { userData.addUser(user); return Response.ok().entity("").build(); }