spring boot restful

1、创建spring boot项目导入依赖

spring boot restful

2、创建结构和这篇博客一样

3、测试sringboot REST 默认的增删改查接口

  • 总接口
    接口地址就是类名小写后在后面加上s
    spring boot restful

  • 分页
    spring boot restful

  • 分页按照顺序
    spring boot restful

  • 查询单条数据
    spring boot restful

  • 插入单条数据
    spring boot restful

  • 修改单条数据
    spring boot restful

  • 删除单条数据
    spring boot restful

4、spring boot rest 自定义查询方法

spring boot restful

  • 测试
    spring boot restful
    此时的路径太长是可以调整的

http://localhost:8080/books/search/findByNameContaining?name=三

spring boot restful
结果:
spring boot restful