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:edu.uiowa.icts.bluebutton.resource.PersonResource.java
@RequestMapping(value = { "{personId}" }, method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) public String delete(@PathVariable("personId") Integer personId) { Person person = bluebuttonDaoService.getPersonService().findById(personId); if (person == null) { throw new EntityNotFoundException(); }//from ww w .ja va2 s .co m bluebuttonDaoService.getPersonService().delete(person); return ""; }
From source file:net.triptech.metahive.web.OrganisationController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @PreAuthorize("hasRole('ROLE_ADMIN')") public String delete(@PathVariable("id") Long id, Model uiModel, HttpServletRequest request) { Organisation.findOrganisation(id).remove(); uiModel.asMap().clear();//from www . ja v a 2 s .co m FlashScope.appendMessage(getMessage("metahive_delete_complete", Organisation.class), request); return "redirect:/organisations"; }
From source file:com.company.eleave.leave.rest.HolidayController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) public ResponseEntity<Void> delete(@PathVariable("id") final Long holidayId) { final Holiday holiday = holidayService.getById(holidayId); if (holiday == null) { throw new ElementNotFoundException(holidayId, ErrorCode.LEAVE_TYPE_NOT_FOUND.getCode()); }/*from www . j ava2 s. com*/ holidayService.delete(holidayId); return new ResponseEntity<>(HttpStatus.OK); }
From source file:cn.aozhi.songify.rest.TaskRestController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT)//from ww w. ja v a 2 s . c o m public void delete(@PathVariable("id") Long id) { taskService.deleteTask(id); }
From source file:com.thesoftwareguild.capstoneblog.controller.HomeController.java
@RequestMapping(value = "/post/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT)//from www .j a v a2 s . c o m public void removePost(@PathVariable("id") int id) { dao.removePost(id); }
From source file:io.curly.gathering.list.GatheringController.java
@RequestMapping(value = "/{listId}", method = RequestMethod.DELETE) public DeferredResult<HttpEntity<?>> delete(@PathVariable String listId, @GitHubAuthentication User user) { return defer(storage.findOne(listId, user) .map(res -> res.<ResourceNotFoundException>orElseThrow(ResourceNotFoundException::new)) .doOnNext(storage::delete).map(gatheringList -> new ResponseEntity<>(HttpStatus.NO_CONTENT))); }
From source file:com.todo.backend.web.rest.TodoApi.java
@RequestMapping(value = "/todo/{id}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Timed/*from w w w .j a v a2 s . c o m*/ @Transactional public ResponseEntity<Void> deleteTodo(@PathVariable Long id) { log.debug("DELETE /todo/{}", id); todoRepository.delete(id); return ResponseEntity.ok().build(); }
From source file:ca.qhrtech.controllers.UserController.java
@ApiMethod(description = "Deletes the User at the specified location") @RequestMapping(value = "/user/{id}", method = RequestMethod.DELETE) public ResponseEntity<BGLUser> deleteUser(@PathVariable("id") long id) { if (userService.findUserById(id) == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); }// w ww.jav a 2 s. c o m userService.deleteUser(id); return new ResponseEntity<>(HttpStatus.NO_CONTENT); }
From source file:com.mycompany.flooringmvc.controllers.FlooringController.java
@RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseBody// w w w. ja va2 s .com public void delete(@Valid @PathVariable("id") Integer orderId) { Order order = dao.get(orderId); dao.delete(order); }
From source file:org.hsweb.web.controller.draft.DraftController.java
/** * ?,??(true or false)/*from w ww .j av a 2 s . com*/ * * @param key ? * @return */ @RequestMapping(value = "/{key}", method = RequestMethod.DELETE) @AccessLogger("?") public ResponseMessage removeAllDraft(@PathVariable("key") String key) { User user = WebUtil.getLoginUser(); return ResponseMessage.ok(draftService.removeDraft(key, user.getId())); }