28ea711b24
- Replaced Go stdlib server with Quarkus (RESTEasy Reactive + Jackson) - 7 Java classes: Game POJO, GameService (JSON file I/O), 4 REST resources, static file serving - Same JSON-per-game storage, same ZIP upload + bundle creation - Same Svelte frontend (unchanged), built into the JAR via maven-resources-plugin - Multi-stage Dockerfile: Node → Maven → JRE runtime
107 lines
4.0 KiB
Java
107 lines
4.0 KiB
Java
package com.dostalgia;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
import java.time.Instant;
|
|
import java.util.List;
|
|
|
|
/** Represents a single DOS game, stored as data/games/{id}/game.json */
|
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
public class Game {
|
|
private String id;
|
|
private String title;
|
|
private Integer year;
|
|
private String genre;
|
|
private String developer;
|
|
private String publisher;
|
|
private String description;
|
|
private Double rating;
|
|
private List<String> platforms;
|
|
|
|
private String bundleType; // "standard" or "sockdrive"
|
|
private String bundleFile; // relative path within game dir
|
|
|
|
private Integer igdbId;
|
|
private String igdbCoverId;
|
|
|
|
private boolean hasCover;
|
|
private boolean hasScreenshots;
|
|
private List<String> screenshots;
|
|
|
|
private boolean ready;
|
|
private Instant createdAt;
|
|
private Instant updatedAt;
|
|
|
|
// ─── Constructors ────────────────────────────────────────────
|
|
|
|
public Game() {}
|
|
|
|
public Game(String id, String title) {
|
|
this.id = id;
|
|
this.title = title;
|
|
this.ready = false;
|
|
this.createdAt = Instant.now();
|
|
this.updatedAt = Instant.now();
|
|
}
|
|
|
|
// ─── Getters & Setters ──────────────────────────────────────
|
|
|
|
public String getId() { return id; }
|
|
public void setId(String id) { this.id = id; }
|
|
|
|
public String getTitle() { return title; }
|
|
public void setTitle(String title) { this.title = title; }
|
|
|
|
public Integer getYear() { return year; }
|
|
public void setYear(Integer year) { this.year = year; }
|
|
|
|
public String getGenre() { return genre; }
|
|
public void setGenre(String genre) { this.genre = genre; }
|
|
|
|
public String getDeveloper() { return developer; }
|
|
public void setDeveloper(String developer) { this.developer = developer; }
|
|
|
|
public String getPublisher() { return publisher; }
|
|
public void setPublisher(String publisher) { this.publisher = publisher; }
|
|
|
|
public String getDescription() { return description; }
|
|
public void setDescription(String description) { this.description = description; }
|
|
|
|
public Double getRating() { return rating; }
|
|
public void setRating(Double rating) { this.rating = rating; }
|
|
|
|
public List<String> getPlatforms() { return platforms; }
|
|
public void setPlatforms(List<String> platforms) { this.platforms = platforms; }
|
|
|
|
public String getBundleType() { return bundleType; }
|
|
public void setBundleType(String bundleType) { this.bundleType = bundleType; }
|
|
|
|
public String getBundleFile() { return bundleFile; }
|
|
public void setBundleFile(String bundleFile) { this.bundleFile = bundleFile; }
|
|
|
|
public Integer getIgdbId() { return igdbId; }
|
|
public void setIgdbId(Integer igdbId) { this.igdbId = igdbId; }
|
|
|
|
public String getIgdbCoverId() { return igdbCoverId; }
|
|
public void setIgdbCoverId(String igdbCoverId) { this.igdbCoverId = igdbCoverId; }
|
|
|
|
public boolean isHasCover() { return hasCover; }
|
|
public void setHasCover(boolean hasCover) { this.hasCover = hasCover; }
|
|
|
|
public boolean isHasScreenshots() { return hasScreenshots; }
|
|
public void setHasScreenshots(boolean hasScreenshots) { this.hasScreenshots = hasScreenshots; }
|
|
|
|
public List<String> getScreenshots() { return screenshots; }
|
|
public void setScreenshots(List<String> screenshots) { this.screenshots = screenshots; }
|
|
|
|
public boolean isReady() { return ready; }
|
|
public void setReady(boolean ready) { this.ready = ready; }
|
|
|
|
public Instant getCreatedAt() { return createdAt; }
|
|
public void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; }
|
|
|
|
public Instant getUpdatedAt() { return updatedAt; }
|
|
public void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; }
|
|
}
|