首页 > 解决方案 > 更改 HATEOAS 链接的默认结构

问题描述

如何更改 Hateoas 链接的默认结构:

 "first": {
    "href": "http://localhost:8081/api/offer/?page=0&size=20"
 },
 "self": {
    "href": "http://localhost:8081/api/offer/"
 },
 "next": {
    "href": "http://localhost:8081/api/offer/?page=1&size=20"
 },
 "last": {
     "href": "http://localhost:8081/api/offer/?page=2&size=20"
 }

变成这样:

 {
    "href": "http://localhost:8081/api/offer/?page=0&size=20",
    "rel" : "next",
    "method": "GET"
 },

标签: spring-hateoas

解决方案


推荐阅读