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

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

Introduction

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

Prototype

RequestMethod PUT

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

Click Source Link

Usage

From source file:com.ebay.logstorm.server.controllers.ClusterController.java

@RequestMapping(method = RequestMethod.PUT)
@Transactional/*  www .j  av a  2s  .  c  o  m*/
public @ResponseBody ResponseEntity<RestResponse<ClusterEntity>> updateClusterEntity(
        @RequestBody ClusterEntity clusterEntity) {
    return RestResponse.async(() -> entityService.updateCluster(clusterEntity)).get();
}

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

@RequestMapping(method = RequestMethod.PUT)
public void updateSeat(@RequestBody @Valid SeatDto seat) {
    seatService.update(seat);
}

From source file:br.com.s2it.snakes.controllers.CarController.java

@CrossOrigin("*")
@RequestMapping(value = "/damage/{licensePlate}", method = RequestMethod.PUT)
public ResponseEntity<Car> doDamage(final @RequestBody List<CarDamage> damage,
        final @PathVariable(value = "licensePlate") String licensePlate) {
    if (licensePlate == null || licensePlate.isEmpty() || damage == null)
        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);

    try {/*  w  ww  . j  a  va2  s  . c  o m*/
        Car car = service.findByLicensePlate(licensePlate);

        if (car.getDamages() == null)
            car.setDamages(new ArrayList<>());

        car.getDamages().addAll(damage);

        return ResponseEntity.status(HttpStatus.OK).body(service.save(car));
    } catch (Exception e) {
        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(null);
    }
}

From source file:com.mum.controller.CardRestController.java

@RequestMapping(value = "/{cardId}", method = RequestMethod.PUT)
@ResponseStatus(value = HttpStatus.NO_CONTENT)
public void update(@PathVariable(value = "cardId") String cardId, @RequestBody Card card) {
    System.out.println("Update");
    cardServiceImpl.update(cardId, card);

}

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

@RequestMapping(value = "/pelanggan/{kode}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.OK)/*from   w  w  w . j a  v  a 2  s . c  om*/
public void updateDataPelanggan(@PathVariable("kode") String kode, @RequestBody @Valid DataPelanggan k) {
    k.setKode(kode);
    kd.save(k);
}

From source file:com.tsg.cms.TagController.java

@RequestMapping(value = "/tag/{oldTagName}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)/*from   w  w w  . java 2 s .  c o m*/
@ResponseBody
public TagContainer updateTag(@PathVariable("oldTagName") String oldTagName, @RequestBody String newTag) {

    TagContainer tagContainer = new TagContainer();

    tagContainer.setTagName(tagDao.updateTag(newTag, oldTagName));

    return tagContainer;
}

From source file:id.qwack.controller.RoleController.java

@RequestMapping(method = RequestMethod.PUT)
public String update(@RequestBody Roles rl) {
    RolesService role = new RolesService();
    role.update(rl);/*from ww  w.  j  a  v  a2s. c o  m*/

    return "Role ID " + rl.getId() + " updated";
}

From source file:com.xpanxion.userprojecthibernate.controllers.RESTController.java

@RequestMapping(value = "/user/{id}", method = RequestMethod.PUT)
@ResponseStatus(HttpStatus.NO_CONTENT)/*  w  w  w .j a  v a2  s. com*/
public void putUser(@PathVariable("id") int id, @RequestBody UserBean userToUpdate) {
    userToUpdate.setId(id);
    userService.updateUser(userToUpdate);
}

From source file:runtheshow.resource.webservice.ArtisteService.java

@RequestMapping(value = "/update", method = RequestMethod.PUT, consumes = "application/json; charset=UTF-8")
public Boolean updateArtiste(@RequestBody ProfileArtiste artiste, Principal user,
        HttpServletResponse response) {/*from  w ww. j a va2s . c  o  m*/
    return artisteMetier.UpdateArtiste(artiste, user);
}

From source file:com.auditbucket.registration.endpoint.TagEP.java

@ResponseBody
@RequestMapping(value = "/", produces = "application/json", consumes = "application/json", method = RequestMethod.PUT)
public Collection<TagInputBean> createTags(@RequestBody List<TagInputBean> tagInputs, String apiKey,
        @RequestHeader(value = "Api-Key", required = false) String apiHeaderKey) throws DatagioException {
    Company company = registrationService.resolveCompany(ApiKeyHelper.resolveKey(apiHeaderKey, apiKey));

    schemaDao.ensureUniqueIndexes(company, tagInputs, tagService.getExistingIndexes());
    tagService.createTagsNoRelationships(company, tagInputs);
    return tagService.processTags(company, tagInputs);

}