List of usage examples for org.springframework.http HttpStatus OK
HttpStatus OK
To view the source code for org.springframework.http HttpStatus OK.
Click Source Link
From source file:com.tribuo.backend.controllers.ComprasController.java
/** * * @return// w w w .j a va2s . c om */ @RequestMapping(value = "/all", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List<Compras>> getCompras() { List<Compras> u = se.getCompras(); return new ResponseEntity<>(u, HttpStatus.OK); }
From source file:com.tribuo.backend.controllers.MarcasController.java
/** * * @return/*from w w w .j a v a2 s . c om*/ */ @RequestMapping(value = "/all", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List<Marcas>> getUsuarios() { List<Marcas> m = se.getMarcas(); return new ResponseEntity<>(m, HttpStatus.OK); }
From source file:com.ar.dev.tierra.api.controller.CategoriaController.java
@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> getAll() { List<Categoria> categorias = facadeService.getCategoriaDAO().getAll(); if (!categorias.isEmpty()) { return new ResponseEntity<>(categorias, HttpStatus.OK); } else {/*from w w w . j av a 2s .c om*/ return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } }
From source file:com.tribuo.backend.controllers.TiendasController.java
/** * * @return//w w w .j a v a 2s .co m */ @RequestMapping(value = "/all", method = RequestMethod.GET) @ResponseBody public ResponseEntity<List<Tiendas>> getTiendas() { List<Tiendas> u = se.getTiendas(); return new ResponseEntity<>(u, HttpStatus.OK); }
From source file:br.com.porao.ui.ControllerCliente.java
@RequestMapping(value = "/cliente/add", produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ResponseEntity<?> addCliente(Cliente cliente) { try {/* w w w . j a va 2s . c o m*/ this.fachada.cadastrarCliente(cliente); return new ResponseEntity<String>(HttpStatus.OK); } catch (ClienteExistenteException clienteexistente) { return new ResponseEntity<ClienteExistenteException>(clienteexistente, HttpStatus.BAD_REQUEST); } }
From source file:com.ar.dev.tierra.api.controller.EntidadBancariaController.java
@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> getAll() { List<EntidadBancaria> list = facadeService.getEntidadBancariaDAO().getAll(); if (!list.isEmpty()) { return new ResponseEntity<>(list, HttpStatus.OK); } else {/*from www .j a v a2 s. co m*/ return new ResponseEntity<>(HttpStatus.BAD_REQUEST); } }
From source file:net.eusashead.hateoas.conditional.interceptor.SyncTestController.java
@RequestMapping(method = RequestMethod.HEAD) public ResponseEntity<String> head() { HttpHeaders headers = new HttpHeaders(); headers.setETag("\"123456\""); return new ResponseEntity<String>(headers, HttpStatus.OK); }
From source file:io.fourfinanceit.homework.controller.ClientController.java
@RequestMapping(value = "/client", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Iterable<Client>> getClients() { Iterable<Client> clients = clientRepository.findAll(); return new ResponseEntity<Iterable<Client>>(clients, HttpStatus.OK); }
From source file:com.tamnd2.basicwebapp.rest.mvc.BlogEntryController.java
@RequestMapping(value = "/{blogEntryId}", method = RequestMethod.GET) public ResponseEntity<BlogEntryResource> getBlogEntry(@PathVariable Long blogEntryId) { BlogEntry entry = service.findBlogEntry(blogEntryId); if (entry != null) { BlogEntryResource res = (new BlogEntryResourceAsm()).toResource(entry); return new ResponseEntity<BlogEntryResource>(res, HttpStatus.OK); } else {//from ww w . ja v a 2s. co m return new ResponseEntity<BlogEntryResource>(HttpStatus.NOT_FOUND); } }
From source file:net.eusashead.hateoas.conditional.interceptor.AsyncTestController.java
@RequestMapping(method = RequestMethod.GET) public Callable<ResponseEntity<String>> get() { return new Callable<ResponseEntity<String>>() { @Override/* w w w. j ava2 s . co m*/ public ResponseEntity<String> call() throws Exception { HttpHeaders headers = new HttpHeaders(); headers.setETag("\"123456\""); return new ResponseEntity<String>("hello", headers, HttpStatus.OK); } }; }