// Path: authrite-service/src/main/java/com/lewisd/authrite/jdbc/dao/PlayerDao.java
// @RegisterMapper(DBPlayerMapper.class)
// public interface PlayerDao {
// 
//     @SqlQuery("select * from players where gameId=:gameId")
//     ImmutableList<DBPlayer> getPlayersForGame(@Bind("gameId") UUID gameId);
// 
//     @SqlQuery("select * from players where userId=:userId")
//     ImmutableList<DBPlayer> getPlayersForUser(@Bind("userId") UUID userId);
// 
// }
// 
// Path: authrite-service/src/main/java/com/lewisd/authrite/resources/model/Player.java
// public class Player {
//     private final UUID gameId;
// 
//     public Player(final UUID gameId) {
// 
//         this.gameId = gameId;
//     }
// 
//     public UUID getGameId() {
//         return gameId;
//     }
// 
//     public static Player fromDB(final DBPlayer player) {
//         return new Player(
//                 player.getGameId()
//         );
//     }
// 
// }


import com.lewisd.authrite.jdbc.dao.PlayerDao;
import com.lewisd.authrite.resources.model.Player;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;
import java.util.UUID;
import static java.util.stream.Collectors.toList;
package com.lewisd.authrite.resources;




@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public class PlayersResource {

    private final DBI dbi;

    @Inject
    public PlayersResource(final DBI dbi) {
        this.dbi = dbi;
    }

    @Path("/games/{gameId}/players")
    @GET
    public List<Player> listPlayersInGame(@PathParam("gameId") final UUID gameId) {
        try (final Handle handle = dbi.open()) {
// Path: authrite-service/src/main/java/com/lewisd/authrite/jdbc/dao/PlayerDao.java
// @RegisterMapper(DBPlayerMapper.class)
// public interface PlayerDao {
// 
//     @SqlQuery("select * from players where gameId=:gameId")
//     ImmutableList<DBPlayer> getPlayersForGame(@Bind("gameId") UUID gameId);
// 
//     @SqlQuery("select * from players where userId=:userId")
//     ImmutableList<DBPlayer> getPlayersForUser(@Bind("userId") UUID userId);
// 
// }
// 
// Path: authrite-service/src/main/java/com/lewisd/authrite/resources/model/Player.java
// public class Player {
//     private final UUID gameId;
// 
//     public Player(final UUID gameId) {
// 
//         this.gameId = gameId;
//     }
// 
//     public UUID getGameId() {
//         return gameId;
//     }
// 
//     public static Player fromDB(final DBPlayer player) {
//         return new Player(
//                 player.getGameId()
//         );
//     }
// 
// }


// Path: authrite-service/src/main/java/com/lewisd/authrite/resources/PlayersResource.java
import com.lewisd.authrite.jdbc.dao.PlayerDao;
import com.lewisd.authrite.resources.model.Player;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;
import java.util.UUID;
import static java.util.stream.Collectors.toList;

package com.lewisd.authrite.resources;




@Path("/")
@Produces(MediaType.APPLICATION_JSON)
public class PlayersResource {

    private final DBI dbi;

    @Inject
    public PlayersResource(final DBI dbi) {
        this.dbi = dbi;
    }

    @Path("/games/{gameId}/players")
    @GET
    public List<Player> listPlayersInGame(@PathParam("gameId") final UUID gameId) {
        try (final Handle handle = dbi.open()) {
            final PlayerDao playerDao = handle.attach(PlayerDao.class);