How can I simply add a link to a Spring Data REST Entity

后端 未结 3 1919
你的背包
你的背包 2021-01-02 07:20

I have my Entities with Spring Data JPA, but to generate stats about them, I use jOOQ in a Spring @Repository.

Since my methods return either a Li

3条回答
  •  清酒与你
    2021-01-02 07:50

    See this from docs

    @Bean
    public ResourceProcessor> personProcessor() {
    
       return new ResourceProcessor>() {
    
         @Override
         public Resource process(Resource resource) {
    
          resource.add(new Link("http://localhost:8080/people", "added-link"));
          return resource;
         }
       };
    }
    

提交回复
热议问题