Last active
November 16, 2021 13:45
-
-
Save diegolirio/82447bcab90acbaeb966287a78476b70 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
| @Transactional | |
| @Path("/customers") | |
| @Produces(MediaType.APPLICATION_JSON) | |
| @Consumes(MediaType.APPLICATION_JSON) | |
| class CustomerEntrypoint { | |
| @POST | |
| fun created(customer: CustomerEntity): CustomerEntity { | |
| customer.persist() | |
| return customer | |
| } | |
| @GET | |
| @Path("/{id}") | |
| fun get(@PathParam("id") id: Long): CustomerEntity? { | |
| return CustomerEntity.findById(id) | |
| } | |
| @GET | |
| fun getList(): List<CustomerEntity> { | |
| return CustomerEntity.findAll().list() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment