Spring Data Rest Add custom endpoint to specific reposiotry

前端 未结 1 1901
梦如初夏
梦如初夏 2021-01-06 11:39

I would like to add a custom search endpoint to my existing user repository.

My user Repository looks like this:

@RepositoryRestResource(collectionRe         


        
相关标签:
1条回答
  • 2021-01-06 11:52

    I assume your invites endpoint also returns a RepositorySearchesResource ?! Your ResourceProcessor is invoked whenever spring-data-rest serializes a RepositorySearchesResource. If you want different links for users and invites you have some alternatives:

    • use different return types for your search endpoints so you can have different ResourceProcessor implementations
    • put more logic inside your ResourceProcessor to differentiate if you are in your invites or users use case
    0 讨论(0)
提交回复
热议问题