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:springfox.documentation.spring.web.dummy.controllers.PetGroomingService.java

@RequestMapping(value = "voidMethod/{input}", method = RequestMethod.DELETE, headers = {
        "Accept=application/xml,application/json" })
@ResponseStatus(value = HttpStatus.OK, reason = "Just testing")
public void groomingFunctionThatReturnsVoid(@PathVariable("input") String input) throws Exception {
}

From source file:com.artivisi.salary.payroll.system.controller.PinjamanController.java

@RequestMapping(value = "/pinjaman/{id}", method = RequestMethod.DELETE)
public void deletePinjaman(@PathVariable(value = "id") String id) throws Exception {
    if (id == null) {
        throw new Exception("id tidak boleh kosong atau null");
    }//from   w ww  .ja  v a 2s.com

    Pinjaman pinjaman = pinjamanService.findOne(id);
    if (pinjaman == null) {
        throw new Exception("User tidak ditemukan");
    }

    pinjamanService.delete(pinjaman);
}

From source file:com.artivisi.salary.payroll.system.controller.PotonganController.java

@RequestMapping(value = "/potongan/{id}", method = RequestMethod.DELETE)
public void deletePotongan(@PathVariable(value = "id") String id) throws Exception {
    if (id == null) {
        throw new Exception("id tidak boleh kosong atau null");
    }/*from  w ww .j  a  va2s. com*/

    Potongan potongan = potonganService.findOne(id);
    if (potongan == null) {
        throw new Exception("User tidak ditemukan");
    }

    potonganService.delete(potongan);
}

From source file:com.tsg.contactlistmvc.RESTController.java

@RequestMapping(value = "/contact/{id}", method = RequestMethod.DELETE)
@ResponseStatus(HttpStatus.NO_CONTENT)//w ww  .  ja v  a 2  s  .c om
public void deleteContact(@PathVariable("id") int id) {
    dao.removeContact(id);

}

From source file:com.swcguild.group3capstone.controller.AdminController.java

@RequestMapping(value = "/deleteBlog/{id}", method = RequestMethod.DELETE)
public void deleteBlog(@PathVariable("id") int blogID) {
    blogDAO.deleteBlog(blogID);//from   www.  ja  v  a 2s. com
}

From source file:com.easarrive.quartz.aws.api.CloudSearchApi.java

/**
 * /*from   w  w w  .ja v  a 2  s  . co m*/
 *
 * @param searchKey 
 * @return ??
 */
@RequestMapping(value = "/api", method = { RequestMethod.DELETE })
@ResponseBody
public DataDeliveryWrapper<UploadDocumentsResult> delete(@RequestHeader("searchType") String searchKey) {
    try {
        ICloudSearch4DocumentsService cloudSearch4DocumentsService = cloudSearch4DocumentsServiceMap
                .get(searchKey);
        if (cloudSearch4DocumentsService == null) {
            String errorMessage = "??";
            logger.error(errorMessage);
            return new DataDeliveryWrapper<UploadDocumentsResult>(HttpStatus.SC_FORBIDDEN, errorMessage, null);
        }
        UploadDocumentsResult result = cloudSearch4DocumentsService.deleteDocuments4Domain();
        return new DataDeliveryWrapper<UploadDocumentsResult>(HttpStatus.SC_OK, "?", result);
    } catch (Exception e) {
        String errorMessage = "";
        logger.error(errorMessage, e);
        return new DataDeliveryWrapper<UploadDocumentsResult>(HttpStatus.SC_INTERNAL_SERVER_ERROR, errorMessage,
                null);
    }
}

From source file:school.controller.Controller.java

@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
public void delete(@PathVariable Long id, final HttpServletResponse response) {
    setHeaders(response);//from   ww  w.  j a  v  a 2  s  .  c  om
    delete(id);
}

From source file:monkeys.web.MonkeysController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/{id}")
public ResponseEntity<Void> deleteMonkey(@PathVariable Long id) {
    monkeyRepository.delete(id);//  w  ww.ja v a2 s  .  com
    HttpHeaders headers = new HttpHeaders();
    return new ResponseEntity<>(headers, HttpStatus.OK);
}

From source file:com.eyem.rest.GrupoFacadeRest.java

@RequestMapping(value = "/editarGrupo/", consumes = { "application/json" }, method = RequestMethod.DELETE)
public void editarGrupo(Grupo grupo) {
    Grupo grupoActual = grupoService.buscarGrupoPorId(grupo.getIdGrupo());
    grupoService.borrarGrupo(grupoActual);
    grupoService.crearGrupo(grupo);//from w  ww . j  a  v a  2s . co  m
}

From source file:reconf.server.services.security.DeleteUserService.java

@RequestMapping(value = "/user/{user}", method = RequestMethod.DELETE)
@Transactional//w  w w  .  j a va2  s. com
public ResponseEntity<Client> doIt(@PathVariable("user") String user, Authentication authentication) {

    if (ApplicationSecurity.isRoot(user)) {
        return new ResponseEntity<Client>(new Client(user, cannotDeleteRoot), HttpStatus.BAD_REQUEST);
    }

    if (!userDetailsManager.userExists(user)) {
        return new ResponseEntity<Client>(new Client(user, userNotFound), HttpStatus.NOT_FOUND);
    }

    userProducts.deleteByKeyUsername(user);
    userDetailsManager.deleteUser(user);
    return new ResponseEntity<Client>(HttpStatus.OK);
}