Created and updated methods to pull data from db.
This commit is contained in:
parent
e7e5168073
commit
c160703048
4 changed files with 179 additions and 65 deletions
|
@ -9,8 +9,6 @@ public class Achievements {
|
|||
|
||||
public static class Achievement {
|
||||
|
||||
@JsonProperty("GameID")
|
||||
private int gameID;
|
||||
@JsonProperty("Name")
|
||||
private String name;
|
||||
@JsonProperty("Description")
|
||||
|
@ -18,58 +16,49 @@ public class Achievements {
|
|||
@JsonProperty("Stages")
|
||||
private int stages;
|
||||
|
||||
public Achievement(int gameID, String name, String description, int stages) {
|
||||
this.gameID = gameID;
|
||||
public Achievement(String name, String description, int stages) {
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
this.stages = stages;
|
||||
}
|
||||
|
||||
public int getGameID() {
|
||||
return gameID;
|
||||
}
|
||||
// Start Getters/Setters
|
||||
public String getName() { return name; }
|
||||
|
||||
public void setGameID(int gameID) {
|
||||
this.gameID = gameID;
|
||||
}
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public String getDescription() { return description; }
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public void setDescription(String description) { this.description = description; }
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
public int getStages() { return stages; }
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getStages() {
|
||||
return stages;
|
||||
}
|
||||
|
||||
public void setStages(int stages) {
|
||||
this.stages = stages;
|
||||
}
|
||||
public void setStages(int stages) { this.stages = stages; }
|
||||
// End Getters/Setters
|
||||
}
|
||||
|
||||
@JsonProperty("achievements")
|
||||
List<Achievement> achievements;
|
||||
@JsonProperty("GameID")
|
||||
private int gameID;
|
||||
@JsonProperty("GameName")
|
||||
private String gameName;
|
||||
@JsonProperty("Achievements")
|
||||
private List<Achievement> achievements;
|
||||
|
||||
public Achievements() {
|
||||
achievements = new ArrayList<Achievement>();
|
||||
}
|
||||
public Achievements() { achievements = new ArrayList<Achievement>(); }
|
||||
|
||||
public List<Achievement> getAchievements() {
|
||||
return achievements;
|
||||
}
|
||||
// Start Getters/Setters
|
||||
public int getGameID() { return gameID; }
|
||||
|
||||
public void setAchievements(List<Achievement> achievements) {
|
||||
this.achievements = achievements;
|
||||
}
|
||||
public void setGameID(int gameID) { this.gameID = gameID; }
|
||||
|
||||
public String getGameName() { return gameName; }
|
||||
|
||||
public void setGameName(String gameName) { this.gameName = gameName; }
|
||||
|
||||
public List<Achievement> getAchievements() { return achievements; }
|
||||
|
||||
public void setAchievements(List<Achievement> achievements) { this.achievements = achievements; }
|
||||
// End Getters/Setters
|
||||
|
||||
public void addAchievement(Achievement achievement) { this.achievements.add(achievement); };
|
||||
}
|
||||
|
|
57
backend/src/main/java/achievements/data/Games.java
Normal file
57
backend/src/main/java/achievements/data/Games.java
Normal file
|
@ -0,0 +1,57 @@
|
|||
package achievements.data;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class Games {
|
||||
|
||||
public static class Game {
|
||||
|
||||
@JsonProperty("ID")
|
||||
private int id;
|
||||
@JsonProperty("Name")
|
||||
private String name;
|
||||
@JsonProperty("Platforms")
|
||||
private List<String> platforms;
|
||||
|
||||
public Game(int id, String name, String platform) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.platforms = new ArrayList<>();
|
||||
this.platforms.add(platform);
|
||||
}
|
||||
|
||||
// Start Getters/Setters
|
||||
public int getId() { return id; }
|
||||
|
||||
public void setId(int id) { this.id = id; }
|
||||
|
||||
public String getName() { return name; }
|
||||
|
||||
public void setName(String name) { this.name = name; }
|
||||
|
||||
public List<String> getPlatforms() { return platforms; }
|
||||
|
||||
public void setPlatforms(List<String> platforms) { this.platforms = platforms; }
|
||||
|
||||
public void addToPlatforms(String platform) { this.platforms.add(platform); }
|
||||
// End Getters/Setters
|
||||
|
||||
}
|
||||
|
||||
@JsonProperty("Games")
|
||||
private List<Game> games;
|
||||
|
||||
public Games() { games = new ArrayList<Game>(); }
|
||||
|
||||
// Start Getters/Setters
|
||||
public List<Game> getGames() { return games; }
|
||||
|
||||
public void setGames(List<Game> games) { this.games = games; }
|
||||
// End Getters/Setters
|
||||
|
||||
public void addGame(Game game) { this.games.add(game); }
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue