Commit e8628c2d by Rubén Ramírez

feat: [Recurso]: Añadido a recurso, dto y mapper el nuevo atributo para tener imágenes

parent 06a8ae78
......@@ -39,6 +39,8 @@ public class Recurso {
@Column(nullable = false)
private String autor;
private String fotoUrl;
@ElementCollection(targetClass = Genero.class)
@Enumerated(EnumType.STRING)
......@@ -51,11 +53,12 @@ public class Recurso {
@OneToMany(mappedBy = "recurso")
private List<Capitulo> capitulos = new ArrayList<>();
public Recurso(String titulo, String descripcion, LocalDate fechaPublicacion, String autor) {
public Recurso(String titulo, String descripcion, LocalDate fechaPublicacion, String autor, String fotoUrl) {
this.titulo = titulo;
this.descripcion = descripcion;
this.fechaPublicacion = fechaPublicacion;
this.autor = autor;
this.fotoUrl = fotoUrl;
}
......
......@@ -29,5 +29,7 @@ public class DTORecurso {
@NotBlank
private String autor;
private String fotoUrl;
private Set<Genero> generos = new HashSet<>();
}
......@@ -28,6 +28,7 @@ public class Mapper {
recurso.getDescripcion(),
recurso.getFechaPublicacion(),
recurso.getAutor(),
recurso.getFotoUrl() ,
recurso.getGeneros()
);
}
......@@ -37,7 +38,8 @@ public class Mapper {
dtoRecurso.getTitulo(),
dtoRecurso.getDescripcion(),
dtoRecurso.getFechaPublicacion(),
dtoRecurso.getAutor()
dtoRecurso.getAutor(),
dtoRecurso.getFotoUrl()
);
if (dtoRecurso.getGeneros() != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment