Skip to content

Commit fb66c72

Browse files
committed
cria construtor que recebe o 'GameMinProjection' como argumento e cria variável 'position' + 'get/set'
1 parent 7fadf19 commit fb66c72

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/main/java/com/gabriel_torelo/game_list/dto/GameMinDTO.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.gabriel_torelo.game_list.dto;
22

33
import com.gabriel_torelo.game_list.entities.Game;
4+
import com.gabriel_torelo.game_list.projections.GameMinProjection;
45

56
public class GameMinDTO {
67
private Long id;
78
private String title;
89
private Double score;
910
private String imgUrl;
11+
private Integer position;
1012

1113
public GameMinDTO() {
1214
}
@@ -18,6 +20,14 @@ public GameMinDTO(Game entity) {
1820
imgUrl = entity.getImgUrl();
1921
}
2022

23+
public GameMinDTO(GameMinProjection projection) {
24+
id = projection.getId();
25+
title = projection.getTitle();
26+
score = projection.getScore();
27+
imgUrl = projection.getImgUrl();
28+
position = projection.getPosition();
29+
}
30+
2131
public Long getId() {
2232
return id;
2333
}
@@ -49,4 +59,12 @@ public void setScore(Double score) {
4959
public void setImgUrl(String imgUrl) {
5060
this.imgUrl = imgUrl;
5161
}
62+
63+
public Integer getPosition() {
64+
return position;
65+
}
66+
67+
public void setPosition(Integer position) {
68+
this.position = position;
69+
}
5270
}

0 commit comments

Comments
 (0)