Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slice and page #366

Closed
marccollin opened this issue Jul 16, 2015 · 2 comments
Closed

Slice and page #366

marccollin opened this issue Jul 16, 2015 · 2 comments

Comments

@marccollin
Copy link

Hi,

there is PagedResources we can use in the controller.

We can do

@RequestMapping(value = "/lodgers/{lodgerId}/accountoperations", method = RequestMethod.GET)
    public HttpEntity<PagedResources<AccountOperationDto>> getAccountOperationByLodgerId(@PathVariable("lodgerId") long lodgerId, Pageable pageable, PagedResourcesAssembler assembler) {

        Page<AccountOperationDto> accountOperationDtoPaging = accountOperationService.getAccountOperationByLodgerId(lodgerId, pageable);

        return new ResponseEntity<>(assembler.toResource(accountOperationDtoPaging), HttpStatus.OK);
    }

@RequestMapping(value = "/lodgers/{lodgerId}/accountoperations2", method = RequestMethod.GET)
    public PagedResources<Resource<AccountOperationDto>> getAccountOperationByLodgerId2(@PathVariable("lodgerId") long lodgerId, Pageable pageable) {

        Page<AccountOperationDto> accountOperationDtoPaging = accountOperationService.getAccountOperationByLodgerId(lodgerId, pageable);

        return pagedAssembler.toResource(accountOperationDtoPaging);
    }

Now i would like to use Slice instead of Page.

I don't find any SlicedReources.

What is the correct way to use slice in the controller, restcontroller, client side?

@aaguilera
Copy link
Contributor

Hi @marccollin,
Perhaps this would be better asked at StackOverflow?
Cheers.

@pedrocatre
Copy link

Just for anyone stumbling on this issue, like I did, I created a stackoverflow question since I have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants