This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.meubuscadordecep; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
public class Util { | |
public static String converteJsonEmString(BufferedReader buffereReader) throws IOException { | |
String resposta, jsonEmString = ""; | |
while ((resposta = buffereReader.readLine()) != null) { | |
jsonEmString += resposta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.meubuscadordecep.viacep; | |
import br.com.meubuscadordecep.Util; | |
import br.com.meubuscadordecep.dominio.Endereco; | |
import com.google.gson.Gson; | |
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.net.HttpURLConnection; | |
import java.net.URL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.meubuscadordecep.cliente; | |
import br.com.meubuscadordecep.dominio.Endereco; | |
import br.com.meubuscadordecep.viacep.ServicoDeCep; | |
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) throws Exception { | |
System.out.print("Informe seu CEP: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package br.com.meubuscadordecep.dominio; | |
public class Endereco { | |
String logradouro; | |
String bairro; | |
String localidade; | |
public String getLogradouro() { | |
return logradouro; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<form @submit.prevent="add"> | |
<input type="hidden" v-model="form.id"> | |
<input type="text" v-model="form.name"> | |
<button type="submit" v-show="!updateSubmit">add</button> | |
<button type="button" v-show="updateSubmit" @click="update(form)">Update</button> | |
</form> | |
<ul v-for="user in users" :key="user.idd"> | |
<li> |