官术网_书友最值得收藏!

Creating Spring Data REST service

In the previous example, we fronted our BookRepository interface with a REST controller in order to expose the data behind it via a web RESTful API. While this is definitely a quick and easy way to make the data accessible, it does require us to manually create a controller and define the mappings for all the desired operations. To minimize the boilerplate code, Spring provides us with a more convenient way: spring-boot-starter-data-rest. This allows us to simply add an annotation to the repository interface and Spring will do the rest to expose it to the web.

We will continue from where we finished in the previous recipe, and so the entity models and the BookRepository interface should already exist.

主站蜘蛛池模板: 普兰县| 威信县| 平邑县| 玉山县| 漳州市| 汝州市| 邹平县| 新兴县| 石河子市| 徐闻县| 阳原县| 大余县| 西充县| 吴忠市| 朔州市| 额尔古纳市| 会泽县| 景宁| 苏尼特左旗| 内江市| 尚志市| 扎鲁特旗| 德庆县| 江山市| 宁远县| 随州市| 汕头市| 龙海市| 花莲县| 通渭县| 教育| 贞丰县| 咸宁市| 洞头县| 大化| 乐清市| 天等县| 南昌市| 甘肃省| 灵宝市| 奇台县|