Last active
October 11, 2020 13:33
-
-
Save thiagolenz/d5f5b56b3e2d5d60e5c462107f8f4a30 to your computer and use it in GitHub Desktop.
PessoaDTOAPI
This file contains hidden or 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
public class PessoaDTO { | |
private Long id; | |
private String nome; | |
// dados do endereco | |
private String rua; | |
private String numero; | |
private String bairro; | |
private String cep; | |
private String cidade; | |
private String uf; | |
} | |
@Controller | |
@RequestMapping("/pessoa") | |
public class PessoaAPI { | |
@Autowired private PessoaService pessoaService; | |
@PostMapping | |
@ResponseBody | |
public Pessoa save (@RequestBody PessoaDTO pessoaDTO) { | |
return pessoaService.save (pessoaDTO); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment