Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am consuming Spring Data REST HATEOAS HAL with RestTemplate.

(我正在使用带有RestTemplate的Spring Data REST HATEOAS HAL。)

In this example, I want to change http://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 。)

Is there any way if we can do this?

(有什么办法可以做到吗?)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
412 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...