Guest User

Untitled

a guest
May 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // Requisicao do id a ser buscado pelo metodo get
  2. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  3. public ResponseEntity<Produto> find(@PathVariable Integer id) {
  4.  
  5. Produto obj = service.find(id);
  6. return ResponseEntity.ok().body(obj);
  7.  
  8. }
  9.  
  10. @RequestMapping(method=RequestMethod.GET)
  11. public ResponseEntity<Page<ProdutoDTO>> findPage(
  12. @RequestParam(value="nome", defaultValue="") String nome,
  13. @RequestParam(value="categorias", defaultValue="") String categorias,
  14. @RequestParam(value="page", defaultValue="0") Integer page,
  15. @RequestParam(value="linesPerPage", defaultValue="24") Integer linesPerPage,
  16. @RequestParam(value="orderBy", defaultValue="nome") String orderBy,
  17. @RequestParam(value="direction", defaultValue="ASC") String direction) {
  18. String nomeDecoded = URL.decodeParam(nome);
  19. List<Integer> ids = URL.decodeIntList(categorias); ---- ERRO NESSA LINHA
  20. Page<Produto> list = service.search(nomeDecoded, ids, page, linesPerPage, orderBy, direction);
  21. Page<ProdutoDTO> listDto = list.map(obj -> new ProdutoDTO(obj));
  22. return ResponseEntity.ok().body(listDto);
  23. }
Add Comment
Please, Sign In to add comment