List of usage examples for org.springframework.web.bind.annotation RequestMethod DELETE
RequestMethod DELETE
To view the source code for org.springframework.web.bind.annotation RequestMethod DELETE.
Click Source Link
From source file:fr.esiea.windmeal.controller.crud.CrudUserCtrl.java
@Secured("ROLE_USER") @RequestMapping(value = "/{idUser}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK)//w w w . j a v a 2 s. co m public void delete(@PathVariable String idUser) throws ServiceException, DaoException { LOGGER.info("[Controller] Querying to delete User with id : \"" + idUser + "\""); crudService.remove(idUser); }
From source file:de.hska.ld.core.controller.RoleController.java
/** * <pre>/*w ww .j a va 2 s . c o m*/ * Deletes the role. * * <b>Required roles:</b> ROLE_ADMIN * <b>Path:</b> DELETE {@value Core#RESOURCE_ROLE}/{id} * </pre> * * @param id the role ID as a path variable * @return <b>200 OK</b> if deletion was successful or <br> * <b>404 Not Found</b> if no role exists with the given ID or <br> * <b>403 Forbidden</b> if authorization failed */ @Secured(Core.ROLE_ADMIN) @RequestMapping(method = RequestMethod.DELETE, value = "/{id}") public Callable deleteRole(@PathVariable Long id) { return () -> { Role role = roleService.findById(id); if (role != null) { roleService.delete(role); return new ResponseEntity("", HttpStatus.OK); } else { throw new NotFoundException("id"); } }; }
From source file:com.wavemaker.testcharts203.sales.controller.SalesDataController.java
@RequestMapping(value = "/{id:.+}", method = RequestMethod.DELETE) @WMAccessVisibility(value = AccessSpecifier.APP_ONLY) @ApiOperation(value = "Deletes the SalesData instance associated with the given id.") public boolean deleteSalesData(@PathVariable(value = "id") Integer id) throws EntityNotFoundException { LOGGER.debug("Deleting SalesData with id: {}", id); SalesData deleted = salesDataService.delete(id); return deleted != null; }
From source file:eu.agilejava.javaonedemo.api.RecipeResource.java
@RequestMapping(value = "{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.OK)/*www . j av a 2 s . c o m*/ public void remove(@PathVariable("id") Long id) { recipeService.remove(recipeService.find(id)); }
From source file:com.todo.backend.web.rest.UserApi.java
@RequestMapping(value = "/user/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed// ww w. j a v a 2 s .c om @Transactional @PreAuthorize("hasAuthority('ADMIN')") public ResponseEntity<Void> deleteUser(@PathVariable Long id) { log.debug("DELETE /user/{}", id); userRepository.delete(id); return ResponseEntity.ok().build(); }
From source file:com.lixiaocong.rest.TransmissionController.java
@RequestMapping(method = RequestMethod.DELETE) public Map<String, Object> delete(@RequestParam(required = false, defaultValue = "-1") int id) { List<Integer> ids = null; if (id != -1) { ids = new LinkedList<>(); ids.add(id);//from ww w. ja v a2 s .c o m } try { if (client.torrentRemove(ids, true)) return ResponseMsgFactory.createSuccessResponse(); return ResponseMsgFactory.createFailedResponse("transmission"); } catch (Exception e) { logger.error("transmission ?"); return ResponseMsgFactory.createFailedResponse("transmission?"); } }
From source file:com.multiimages.employeesdb.controller.ImageController.java
@RequestMapping(value = "/{id:.+}", method = RequestMethod.DELETE) @ApiOperation(value = "Deletes the Image instance associated with the given id.") public boolean deleteImage(@PathVariable("id") Integer id) throws EntityNotFoundException { LOGGER.debug("Deleting Image with id: {}", id); Image deleted = imageService.delete(id); return deleted != null; }
From source file:org.openmrs.module.webservices.rest.web.v1_0.controller.openmrs1_9.LocationAttributeController1_9Test.java
@Test public void shouldVoidAttribute() throws Exception { LocationAttribute locationAttribute = service.getLocationAttributeByUuid(getUuid()); Assert.assertFalse(locationAttribute.isVoided()); MockHttpServletRequest request = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); request.addParameter("reason", "unit test"); handle(request);//from www . ja v a 2 s. c o m locationAttribute = service.getLocationAttributeByUuid(getUuid()); Assert.assertTrue(locationAttribute.isVoided()); Assert.assertEquals("unit test", locationAttribute.getVoidReason()); }
From source file:org.scrutmydocs.webapp.api.document.facade.DocumentApi.java
/** * Delete an existing document// w w w . j a va 2 s. c om * @param id * @return */ @RequestMapping(method = RequestMethod.DELETE, value = "/{id}") public @ResponseBody RestResponseDocument delete(@PathVariable String id) { boolean result = documentService.delete(null, null, id); RestResponseDocument response = new RestResponseDocument(); response.setOk(result); return response; }
From source file:org.cloudbyexample.dc.web.service.docker.ApplicationController.java
@Override @RequestMapping(value = DELETE_PK_REQUEST, method = RequestMethod.DELETE) public ApplicationResponse delete(@PathVariable(ID_VAR) Integer id) { logger.info("Delete application. id={}", id); return service.delete(new Application().withId(id)); }