package api;

import Repository.UsersRepository;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

/**
 * Created by gpietrus on 16.02.16.
 */
@Path(value = "/users")
@Produces(MediaType.APPLICATION_JSON)
public class UsersResource
{
    private UsersRepository usersRepository;
    //todo: use injections

    public UsersResource(UsersRepository usersRepository) {
        this.usersRepository = usersRepository;
    }

    @GET
    public List<Object> getUsers() {
        return usersRepository.getAll();
    }

}
