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.budiana.irpan.belajar.controller.PesertaController.java
@RequestMapping(value = "/peserta/{id}", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public ResponseEntity<Peserta> cariPesertaById(@PathVariable("id") String id) { Peserta hasil = pd.findOne(id);/*w ww . j a v a 2s .com*/ if (hasil == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } return new ResponseEntity<Peserta>(hasil, HttpStatus.OK); }
From source file:com.baidu.terminator.manager.action.LinkAction.java
/** * List all links.//from ww w . j a v a2 s . co m * * @return all links */ @RequestMapping(method = RequestMethod.GET) @ResponseBody public ResponseEntity<List<Link>> getAllLink() { List<Link> allLink = linkService.getAllLink(); return new ResponseEntity<List<Link>>(allLink, HttpStatus.OK); }
From source file:org.jtwig.acceptance.functions.RenderTest.java
@RequestMapping(value = "/parameters") public ResponseEntity<String> post(@RequestParam("title") String title) { return new ResponseEntity<>(title, HttpStatus.OK); }
From source file:net.paulgray.lmsrest.grades.GradesController.java
@RequestMapping(method = RequestMethod.GET, produces = "application/json", value = CourseController.PATH + "/{course}/" + GradesController.PATH) public ResponseEntity getAnnouncements(@ContextUser User user, @PathVariable Course course) { return new ResponseEntity(gradesService.getGradesForUserAndCourse(user, course), HttpStatus.OK); }
From source file:br.com.hyperclass.snackbar.restapi.OrderController.java
@RequestMapping(value = "/order/all", method = RequestMethod.GET) public ResponseEntity<ProductsWrapper> orderItemProducts() { return new ResponseEntity<ProductsWrapper>(new ProductsWrapper(order.getProductsOrder()), HttpStatus.OK); }
From source file:com.hypersocket.i18n.json.I18NController.java
@RequestMapping(value = "i18n", method = RequestMethod.GET, produces = { "application/json" }) @ResponseBody/*from www . j a v a2 s. com*/ @ResponseStatus(value = HttpStatus.OK) public Map<String, String> getResources(HttpServletRequest request, HttpServletResponse response) throws IOException { Map<String, String> results = i18nService.getResourceMap(sessionUtils.getLocale(request)); results.put("LANG", sessionUtils.getLocale(request).getLanguage()); return results; }
From source file:gt.dakaik.rest.impl.MenuImpl.java
@Override public ResponseEntity<Menu> findById(int idUsuario, String token, Long id) throws EntidadNoEncontradaException { Menu m = repoMenu.findOne(id); if (m != null) { return new ResponseEntity(m, HttpStatus.OK); } else {/*from ww w.ja va 2s . c o m*/ throw new EntidadNoEncontradaException("Entity Menu"); } }
From source file:br.com.hyperclass.snackbar.restapi.StockController.java
@RequestMapping(value = "/stock/", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<ProductWrapper> addItemStock(@RequestBody final ProductWrapper productWrapper) { final Product product = new Product(productWrapper.getName(), productWrapper.getPrice()); stock.addItemStock(product);/*from w w w .ja v a 2 s . co m*/ return new ResponseEntity<>(HttpStatus.OK); }
From source file:net.eusashead.hateoas.hal.http.converter.RepresentationController.java
@ResponseBody @RequestMapping(value = "/responseentity", method = RequestMethod.GET, produces = { "application/hal+json", "application/hal+xml" }) public ResponseEntity<ReadableRepresentation> responseEntity() { return new ResponseEntity<ReadableRepresentation>( HalTestUtils.halFromFile("src/test/resources/basket.json"), HttpStatus.OK); }