I am consuming Spring Data REST HATEOAS HAL with RestTemplate.
(我正在使用带有RestTemplate的Spring Data REST HATEOAS HAL。)
In this example, I want to changehttp://localhost:18080/api/customers/3
to http://localhost:18080/api-management/customer/api/customers/3
. (在此示例中,我想将http://localhost:18080/api/customers/3
更改为http://localhost:18080/api-management/customer/api/customers/3
。)
(有什么办法可以做到吗?)
Actually I am executing Wrapper which is calling Actual domain APIs and getting the response.
(实际上,我正在执行包装程序,该包装程序调用实际域API并获取响应。)
Naturally HATEOAS link will be generated are of domain API, but for outside world like Consumers, I want to show wrapper named links.(自然会生成HATEOAS链接,这些链接是域API的,但是对于外部世界(如消费者),我想显示包装命名链接。)
{
"links" : [ {
"rel" : "self",
"href" : "http://localhost:18080/api/customers?page=0&size=100{&sort}"
}, {
"rel" : "search",
"href" : "http://localhost:18080/api/customers/search"
}, {
"rel" : "customer",
"href" : "http://localhost:18080/api/customers/1"
}, {
"rel" : "customer",
"href" : "http://localhost:18080/api/customers/2"
}, {
"rel" : "customer",
"href" : "http://localhost:18080/api/customers/3"
}, {
"rel" : "customer",
"href" : "http://localhost:18080/api/customers/4"
}, {
"rel" : "customer",
"href" : "http://localhost:18080/api/customers/5"
} ],
"content" : [ ],
"page" : {
"size" : 100,
"totalElements" : 5,
"totalPages" : 1,
"number" : 0
}
}
ask by PAA translate from so