Created
June 4, 2018 10:20
-
-
Save lordofthejars/d935973b6edea12f76d40bf79e4986f2 to your computer and use it in GitHub Desktop.
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
@RestController | |
public class CustomerController { | |
@Autowired | |
CustomerRepository customerRepository; | |
@GetMapping("/init") | |
public void initializeDb() { | |
customerRepository.save(new Customer("Alex", "")); | |
customerRepository.save(new Customer("Ada", "")); | |
customerRepository.save(new Customer("Alexandra", "")); | |
} | |
@GetMapping("/customer") | |
public @ResponseBody Iterable<Customer> getCustomers() { | |
return customerRepository.findAll(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment