Rest 如何添加资源并指定相关元素?

Rest 如何添加资源并指定相关元素?,rest,spring-data-neo4j,spring-data-rest,spring-data-neo4j-4,Rest,Spring Data Neo4j,Spring Data Rest,Spring Data Neo4j 4,我有一个游戏提示网站的简单API: /class是游戏中类的端点 /tip是提示的端点 /user是用户的端点 每个提示有3个关系: (:User)-[:AUTHORED]-(:Tip) (:类) '{"content":"TEST", "forClass":"/class/2", "againstClass":"/class/2"}' { "_embedded" : { "tip" : [ ] }, "_links" : { "self" : {

我有一个游戏提示网站的简单API:

  • /class
    是游戏中类的端点
  • /tip
    是提示的端点
  • /user
    是用户的端点
每个提示有3个关系:

  • (:User)-[:AUTHORED]-(:Tip)
  • (:类)
    
    '{"content":"TEST", "forClass":"/class/2", "againstClass":"/class/2"}'
    
    {
      "_embedded" : {
        "tip" : [ ]
      },
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/class/2/tips"
        }
      }
    }
    
    {
      "content" : "TEST",
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/tip/9"
        },
        "tip" : {
          "href" : "http://localhost:8080/tip/9"
        },
        "author" : {
          "href" : "http://localhost:8080/tip/9/author"
        },
        "againstClass" : {
          "href" : "http://localhost:8080/tip/9/againstClass"
        },
        "forClass" : {
          "href" : "http://localhost:8080/tip/9/forClass"
        }
      }
    }
    
    {
      "name" : null,
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/class/2"
        },
        "bnSClass" : {
          "href" : "http://localhost:8080/class/2"
        },
        "tips" : {
          "href" : "http://localhost:8080/class/2/tips"
        }
      }
    }