// Path: src/main/java/org/cri/redmetrics/csv/CsvEntityConverter.java
// public interface CsvEntityConverter<E extends Entity> {
// 
//     public void write(CSVWriter csvWriter, List<E> models);
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/dao/GameDao.java
// public class GameDao extends EntityDao<Game> {
// 
//     @Inject
//     public GameDao(ConnectionSource connectionSource) throws SQLException {
//         super(connectionSource, Game.class);
//     }
// 
//     @Override
//     public Game create(Game game) {
//         if (game.getName() == null || game.getName().isEmpty())
//             throw new InconsistentDataException("Game name is required");
//         game.setAdminKey(UUID.randomUUID());
//         return super.create(game);
//     }
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/json/GameJsonConverter.java
// public class GameJsonConverter extends EntityJsonConverter<Game> {
// 
//     @Inject
//     GameJsonConverter(Gson gson, JsonParser jsonParser) {
//         super(Game.class, gson, jsonParser);
//     }
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/model/Game.java
// @Data
// @DatabaseTable(tableName = "games")
// @NoArgsConstructor
// @AllArgsConstructor
// @EqualsAndHashCode(callSuper = true)
// public class Game extends Entity {
// 
//     @DatabaseField(dataType = DataType.UUID)
//     private UUID adminKey;
// 
//     @DatabaseField(canBeNull = false)
//     private String name;
// 
//     @DatabaseField
//     private String author;
// 
//     @DatabaseField
//     private String description;
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/model/ResultsPage.java
// public class ResultsPage<E extends Entity> {
//     public ResultsPage(long total, long page, long perPage, List<E> results) {
//         this.total = total;
//         this.page = page;
//         this.perPage = perPage;
//         this.results = results;
//     }
// 
//     public long total;
//     public long page;
//     public long perPage;
//     public List<E> results;
// }


import com.google.inject.Inject;
import org.cri.redmetrics.csv.CsvEntityConverter;
import org.cri.redmetrics.dao.GameDao;
import org.cri.redmetrics.json.GameJsonConverter;
import org.cri.redmetrics.model.Game;
import org.cri.redmetrics.model.ResultsPage;
import spark.Request;
import java.util.UUID;
package org.cri.redmetrics.controller;




public class GameController extends Controller<Game, GameDao> {

    @Inject
    GameController(GameDao dao, GameJsonConverter jsonConverter, CsvEntityConverter<Game> csvEntityConverter) {
// Path: src/main/java/org/cri/redmetrics/csv/CsvEntityConverter.java
// public interface CsvEntityConverter<E extends Entity> {
// 
//     public void write(CSVWriter csvWriter, List<E> models);
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/dao/GameDao.java
// public class GameDao extends EntityDao<Game> {
// 
//     @Inject
//     public GameDao(ConnectionSource connectionSource) throws SQLException {
//         super(connectionSource, Game.class);
//     }
// 
//     @Override
//     public Game create(Game game) {
//         if (game.getName() == null || game.getName().isEmpty())
//             throw new InconsistentDataException("Game name is required");
//         game.setAdminKey(UUID.randomUUID());
//         return super.create(game);
//     }
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/json/GameJsonConverter.java
// public class GameJsonConverter extends EntityJsonConverter<Game> {
// 
//     @Inject
//     GameJsonConverter(Gson gson, JsonParser jsonParser) {
//         super(Game.class, gson, jsonParser);
//     }
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/model/Game.java
// @Data
// @DatabaseTable(tableName = "games")
// @NoArgsConstructor
// @AllArgsConstructor
// @EqualsAndHashCode(callSuper = true)
// public class Game extends Entity {
// 
//     @DatabaseField(dataType = DataType.UUID)
//     private UUID adminKey;
// 
//     @DatabaseField(canBeNull = false)
//     private String name;
// 
//     @DatabaseField
//     private String author;
// 
//     @DatabaseField
//     private String description;
// 
// }
// 
// Path: src/main/java/org/cri/redmetrics/model/ResultsPage.java
// public class ResultsPage<E extends Entity> {
//     public ResultsPage(long total, long page, long perPage, List<E> results) {
//         this.total = total;
//         this.page = page;
//         this.perPage = perPage;
//         this.results = results;
//     }
// 
//     public long total;
//     public long page;
//     public long perPage;
//     public List<E> results;
// }


// Path: src/main/java/org/cri/redmetrics/controller/GameController.java
import com.google.inject.Inject;
import org.cri.redmetrics.csv.CsvEntityConverter;
import org.cri.redmetrics.dao.GameDao;
import org.cri.redmetrics.json.GameJsonConverter;
import org.cri.redmetrics.model.Game;
import org.cri.redmetrics.model.ResultsPage;
import spark.Request;
import java.util.UUID;

package org.cri.redmetrics.controller;




public class GameController extends Controller<Game, GameDao> {

    @Inject
    GameController(GameDao dao, GameJsonConverter jsonConverter, CsvEntityConverter<Game> csvEntityConverter) {
        super("game", dao, jsonConverter, csvEntityConverter);