私は現在JSONファイルにリンク可能なデータを持っています。私はAccount.class(Account.java、リソース、アセンブラ、コントローラ、embeddableなど)を持ち、Post.classも同じです。しかし、私はその投稿のデータベースレコードに投稿の著者を埋め込みたいと思っています。どのように私はこれを実装するのですSpring HATEOASを使用したリンクの埋め込み
"content": "New content",
"time": "18.00",
"gender": null,
"age": null,
"id": "570faae01bdbea94f8c79307",
"_links": {
"self": {
"href": "http://localhost:8080/posts/570faae01bdbea94f8c79307"
},
"post": {
"href": "http://localhost:8080/posts/570faae01bdbea94f8c79307"
}
"madeBy": {
"href": "http://localhost:8080/accounts/someId"
}
:?私はこのようなものを持ちたい
"embeddeds": null,
"content": "New content",
"time": "18.00",
"gender": null,
"age": null,
"_links": {
"self": {
"href": "http://localhost:8080/posts/570faae01bdbea94f8c79307"
}
}
:今、私はこれを持っていますかこの投稿を作成したアカウントのリンクを投稿自体に埋め込む必要があります。 POSTコントローラにアカウントを含める必要がありますか、埋め込み可能なもので何かを調整する必要がありますか?私はどこから始めるべきかわかりません。