我已经搜索了几天关于如何实现包含 HATEOAS 链接 + 使用 Spring boot 和 JPA 分页(无 spring 数据休息)的 Spring REST API,如下随机示例:
\n{\n "_links": {\n "first": {\n "href": "http://localhost:8080/api/albums-list?page=0&size=2&sort=title,desc"\n },\n "prev": {\n "href": "http://localhost:8080/api/albums-list?page=0&size=2&sort=title,desc"\n },\n "self": {\n "href": "http://localhost:8080/api/albums-list?page=1&size=2&sort=title,desc"\n },\n "next": {\n "href": "http://localhost:8080/api/albums-list?page=2&size=2&sort=title,desc"\n },\n "last": {\n "href": "http://localhost:8080/api/albums-list?page=4&size=2&sort=title,desc"\n }\n },\n "page": {\n "size": 2,\n "totalElements": 10,\n "totalPages": 5,\n "number": 1\n },\n "_embedded": {\n "albums": [\n {\n "id": 7,\n "title": "Top Hits Vol 7",\n "description": "Top hits vol 7. description",\n "releaseDate": "10-03-1987",\n "actors": [\n {\n "id": …Run Code Online (Sandbox Code Playgroud)