Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Requisicao do id a ser buscado pelo metodo get
- @RequestMapping(value = "/{id}", method = RequestMethod.GET)
- public ResponseEntity<Produto> find(@PathVariable Integer id) {
- Produto obj = service.find(id);
- return ResponseEntity.ok().body(obj);
- }
- @RequestMapping(method=RequestMethod.GET)
- public ResponseEntity<Page<ProdutoDTO>> findPage(
- @RequestParam(value="nome", defaultValue="") String nome,
- @RequestParam(value="categorias", defaultValue="") String categorias,
- @RequestParam(value="page", defaultValue="0") Integer page,
- @RequestParam(value="linesPerPage", defaultValue="24") Integer linesPerPage,
- @RequestParam(value="orderBy", defaultValue="nome") String orderBy,
- @RequestParam(value="direction", defaultValue="ASC") String direction) {
- String nomeDecoded = URL.decodeParam(nome);
- List<Integer> ids = URL.decodeIntList(categorias); ---- ERRO NESSA LINHA
- Page<Produto> list = service.search(nomeDecoded, ids, page, linesPerPage, orderBy, direction);
- Page<ProdutoDTO> listDto = list.map(obj -> new ProdutoDTO(obj));
- return ResponseEntity.ok().body(listDto);
- }
Add Comment
Please, Sign In to add comment