Spring 5.0 Projects
上QQ阅读APP看书,第一时间看更新

Defining the RESTful API controller for city resource

For the city resource we would need the following APIs:

  • Get cities for a given country
  • Add a new city to the country
  • Delete the city from the country

The code for this controller can be found in the CityAPIController class and the tests for the API controller can be found in the CityAPIControllerTest class, which is available in the source code of this book.