1
因此,让我们假设我有两个应用程序,管理人员的Person应用程序和管理Pants的Pants应用程序。在Person应用程序中,Domain对象Person具有一个列表pantsId,它指向Pants应用程序中的一条裤子的ID。Spring Data Rest - 跨应用程序Rest Rest API
我不确定如何使用Spring Data Rest对此进行建模,以便在序列化该人员时,我可以嵌入到外部裤子应用程序裤子实例的链接。 [甚至有/人/ 123 /裤返回这些外裤的资源列表]
寻找沿着以下线的东西:
GET http://www.mydomain.com/personapp/person/123:
{
"name" : "bob",
"age": "30",
"_links" : {
"self" : {
"href" : "http://www.mydomain.com/personapp/person/123"
},
"pants" : {
"href" : "http://www.mydomain.com/pantsapp/pants/456"
"href" : "http://www.mydomain.com/pantsapp/pants/789"
}
}
在附注中,有没有人知道Spring-Data-Rest是否计划支持任何类型的声明式超链接?我可以想象一些注释添加到人名单像@Link(“http://www.domain.com/pantsapp/pants{pantsId},这将允许这种行为 –
Ben