Commit de2522f6 by Rubén Ramírez

feat: [Mapper]: Implementado el mappeador de dto a entidad y viceversa

parent b56942d5
package com.ujaen.tfg.mangaffinity.rest.DTO;
import com.ujaen.tfg.mangaffinity.entidades.Usuario;
import org.springframework.stereotype.Service;
@Service
public class Mapper {
public DTOUsuario dto(Usuario usuario) {
return new DTOUsuario(usuario.getId(), usuario.getEmail(), usuario.getNombreUsuario(), usuario.getContrasenia());
}
public Usuario entity(DTOUsuario dtoUsuario) {
return new Usuario(dtoUsuario.getEmail(), dtoUsuario.getNombreUsuario(), dtoUsuario.getContrasenia());
}
}
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