Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions src/main/java/com/gabriel_torelo/game_list/dto/GameLongDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package com.gabriel_torelo.game_list.dto;

import org.springframework.beans.BeanUtils;
import com.gabriel_torelo.game_list.entities.Game;

public class GameLongDTO {
private Long id;
private String title;
private Integer year;
private String gender;
private String platforms;
private Double score;
private String imgUrl;
private String longDescription;

public GameLongDTO() {
}

public GameLongDTO(Game entity) {
BeanUtils.copyProperties(entity, this);
}

public Long getId() {
return id;
}

public void setId(Long 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 getGender() {
return gender;
}

public void setGender(String gender) {
this.gender = gender;
}

public String getPlatforms() {
return platforms;
}

public void setPlatforms(String platforms) {
this.platforms = platforms;
}

public Double getScore() {
return score;
}

public void setScore(Double score) {
this.score = score;
}

public String getImgUrl() {
return imgUrl;
}

public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}

public String getLongDescription() {
return longDescription;
}

public void setLongDescription(String longDescription) {
this.longDescription = longDescription;
}
}
16 changes: 16 additions & 0 deletions src/main/java/com/gabriel_torelo/game_list/dto/GameMinDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,20 @@ public Double getScore() {
public String getImgUrl() {
return imgUrl;
}

public void setId(Long id) {
this.id = id;
}

public void setTitle(String title) {
this.title = title;
}

public void setScore(Double score) {
this.score = score;
}

public void setImgUrl(String imgUrl) {
this.imgUrl = imgUrl;
}
}
39 changes: 39 additions & 0 deletions src/main/java/com/gabriel_torelo/game_list/dto/GameShortDTO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package com.gabriel_torelo.game_list.dto;

import com.gabriel_torelo.game_list.entities.Game;

public class GameShortDTO {
private GameMinDTO gameMinDTO = new GameMinDTO();
private String shortDescription;

public GameShortDTO() {
}

public GameShortDTO(Game entity) {
gameMinDTO.setId(entity.getId());
gameMinDTO.setTitle(entity.getTitle());
gameMinDTO.setScore(entity.getScore());
gameMinDTO.setImgUrl(entity.getImgUrl());
shortDescription = entity.getShortDescription();
}

public Long getId() {
return gameMinDTO.getId();
}

public String getTitle() {
return gameMinDTO.getTitle();
}

public Double getScore() {
return gameMinDTO.getScore();
}

public String getImgUrl() {
return gameMinDTO.getImgUrl();
}

public String getShortDescription() {
return shortDescription;
}
}