Example usage for org.springframework.web.bind.annotation RequestMethod DELETE

List of usage examples for org.springframework.web.bind.annotation RequestMethod DELETE

Introduction

In this page you can find the example usage for org.springframework.web.bind.annotation RequestMethod DELETE.

Prototype

RequestMethod DELETE

To view the source code for org.springframework.web.bind.annotation RequestMethod DELETE.

Click Source Link

Usage

From source file:com.aplikasi.penjualan.controller.DataPelangganController.java

@RequestMapping(value = "/pelanggan/{kode}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.OK)/*from ww  w.  j av a 2  s .c  o m*/
public void hapusDataPelanggan(@PathVariable("kode") String kode) {
    kd.delete(kode);
}

From source file:org.springframework.samples.petclinic.rest.PetRestController.java

/**
 * Custom handler for remove an pet.//from w ww  .  j a  va 2 s .c  om
 *
 * @param petId the ID of the pet to remove
 */
@RequestMapping(value = "/{petId}", method = RequestMethod.DELETE)
public void removePet(@PathVariable("petId") int petId) {
    this.clinicService.removePet(petId);
}

From source file:plbtw.klmpk.barang.hilang.controller.LogController.java

@RequestMapping(method = RequestMethod.DELETE, produces = "application/json")
public CustomResponseMessage deleteLog(@RequestBody LogRequest logRequest) {
    try {/*  w ww .  ja  v  a 2 s.  co m*/
        logService.deleteLog(logRequest.getIdLog());
        return new CustomResponseMessage(HttpStatus.CREATED, "Delete log successfull");
    } catch (Exception ex) {
        return new CustomResponseMessage(HttpStatus.BAD_REQUEST, ex.toString());
    }
}

From source file:uk.ac.ebi.ricordo.owlkb.rest.controller.TermController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/deleteterm/{query}")
public ModelAndView removeEmployee(@PathVariable String query) {
    List<Term> terms = owlKbService.deleteTerm(query);
    TermList list = new TermList(terms);
    return new ModelAndView(XML_VIEW_NAME, "terms", list);
}

From source file:cz.fi.muni.pa036.airticketbooking.rest.UserRest.java

@RequestMapping(value = "{userId}", method = RequestMethod.DELETE)
public void deleteUser(@PathVariable Long userId) {
    UserDto user = userService.find(userId);
    Long currentUserId = securityService.getCurrentlyLoggedUser().getId();
    if (!securityService.hasPermissionToModifyEntity(user.getId())) {
        throw new AccessDeniedException(
                "Access denied: User " + currentUserId + " cannot delete user " + user.getId());
    }//w w w  .  j  a v  a 2 s  . co  m
    userService.delete(user);
}

From source file:es.fdi.reservas.users.web.UserRestController.java

@RequestMapping(value = "/gestor/administrar/user/restaurar/{idUsuario}", method = RequestMethod.DELETE)
public String restaurarUsuarioGestor(@PathVariable("idUsuario") Long idUsuario) {
    System.out.println(idUsuario);
    user_service.restaurarUser(idUsuario);
    return "redirect:gestor/administrar/usuarios/eliminados/page/1";
}

From source file:io.curly.gathering.item.ItemController.java

@RequestMapping(value = "/delete/artifact/{artifact}", method = RequestMethod.DELETE)
public Callable<HttpEntity<?>> removeItem(@PathVariable String listId, @PathVariable String artifact,
        @GitHubAuthentication User user) {

    return () -> {
        this.interaction.removeItem(new RemovableItem(artifact, listId, ItemType.ARTIFACT), user);
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    };/*from w w w  .  j a v a2s  .  c om*/
}

From source file:cz.fi.muni.pa165.mushroomhunter.rest.HunterRest.java

@RequestMapping(value = "{hunterId}", method = RequestMethod.DELETE)
public void deleteHunter(@PathVariable Long hunterId) {
    HunterDto hunter = hunterService.find(hunterId);
    Long currentUserId = securityService.getCurrentlyLoggedUser().getId();
    if (!securityService.hasPermissionToModifyEntity(hunter.getId())) {
        throw new AccessDeniedException(
                "Access denied: User " + currentUserId + " cannot delete hunter " + hunter.getId());
    }//from   w w w.j  av  a 2s . com
    hunterService.delete(hunter);
}

From source file:com.github.iexel.fontus.web.rest.ProductsController.java

@RequestMapping(value = "ajax/products/{id}", method = RequestMethod.DELETE)
public void deleteProduct(@RequestBody MultiValueMap<String, String> formData,
        @PathVariable("id") int productId) throws ServiceException {

    int productVersion = Integer.parseInt(formData.get("version").get(0));
    deleteProductWrapper(productId, productVersion);
}

From source file:com.epam.reportportal.auth.SsoEndpoint.java

@RequestMapping(value = { "/sso/me" }, method = RequestMethod.DELETE)
public OperationCompletionRS revokeToken(OAuth2Authentication user) {
    String token = ((OAuth2AuthenticationDetails) user.getDetails()).getTokenValue();
    tokenServicesFacade.revokeToken(token);
    return new OperationCompletionRS(String.format("Token '%s' has revoked", token));
}