The aim of this video is to implement the GET endpoint.
- [Narrator] So, we have implemented the first endpoint.…Now, we can implement this next one.…Here, we'll implement the GET restaurants.…So, here you can see we are having request mapping…at class level we want restaurants,…so we can directly use the request mapping…and we are not supposed to provide any URL,…because it is already there at class level,…so directly define the method, so method is…GET and we can define the method,…so it will response entity, so it will return…the collection and collection of restaurant.…
Find by name, because we want a parameter,…so we'll say like request parameter…and we can define the name…and since it is a string, so, that's it.…Again, here we can define the collection.…Collection of restaurants.…
Now, we can simply write the try catch,…so in try block, we can define restaurants…equal to; we can use the service…and...…
Here, we'll mark it as to do, because presently,…we want to implement the (mumbles) version…and it would return the response entity,…so we want to send the OK;…that's sign of the error;…
Released
12/4/2017Note: To get the best results from this course, you should be familiar with the Spring Framework.
This course was created and produced by Packt Publishing. We are honored to host this training in our library.
- Writing sample tests
- Domain-driven design
- Strategic design
- Wrapping controls and pages
- Complex cases for pages and elements
- Testing microservices
Share this video
Embed this video
Video: Implementing the GET endpoint