package br.com.benja.ScreenMatchNew;
import br.com.benja.ScreenMatchNew.model.DadosSerie;
import br.com.benja.ScreenMatchNew.service.ConsumoApi;
import br.com.benja.ScreenMatchNew.service.ConverteDados;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
public class ScreenMatch3NewApplication implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication.run(ScreenMatch3NewApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
var consumoApi = new ConsumoApi();
var json = consumoApi.obterDados("https://www.omdbapi.com/?t=Orphan&type=series&apikey=98a327ae");
System.out.println(json);
ConverteDados conversor = new ConverteDados();
DadosSerie dados = conversor.obterDados(json, DadosSerie.class);
}
}