Example usage for org.springframework.http HttpStatus CREATED

List of usage examples for org.springframework.http HttpStatus CREATED

Introduction

In this page you can find the example usage for org.springframework.http HttpStatus CREATED.

Prototype

HttpStatus CREATED

To view the source code for org.springframework.http HttpStatus CREATED.

Click Source Link

Document

201 Created .

Usage

From source file:com.swcguild.capstoneproject.controller.PinnedPostController.java

@RequestMapping(value = "/pinpost", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
@ResponseBody//from   ww w  .j av  a2 s  .c o  m
public PinPost createPinPost(@Valid @RequestBody PinPost pinPost) {
    dao.addPinPost(pinPost);
    return pinPost;
}

From source file:com.mycompany.geocoordinate.controller.LineController.java

@ResponseStatus(HttpStatus.CREATED)
@PostMapping(value = "/line", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public @ResponseBody ResponseEntity<List<Integer>> line(@RequestBody GeoObject geoObject) {

    boolean check = coordinateMapper.isThereGeoObjectFromLinetype(GeoType.GEOLINE) != null
            & coordinateMapper.selectCoordinateForLineorCircle(geoObject.getCoordinate()) != null;

    coordinateMapper.insertCoordinateForLine(GeoObject.getGEOLINE(), geoObject.getCoordinate());
    List<Integer> responseType = coordinateMapper.selectIdGeo(geoObject.getCoordinate());
    return ResponseEntity.status(HttpStatus.CREATED).body(responseType);

}

From source file:br.ufc.deti.ecgweb.application.controller.DummyController.java

@RequestMapping(value = "/add", method = RequestMethod.POST, produces = "application/json", consumes = "application/json")
@ResponseStatus(HttpStatus.CREATED)
public void addDummy(@RequestBody Dummy dummy) {
    System.out.println("Valor=" + dummy.getValue());
    dummyRepository.save(dummy);/* w ww .ja  va2 s. c om*/
}

From source file:co.agileventure.cloud.review.rest.ReviewController.java

@RequestMapping(method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public Review create(@RequestBody @Valid Review review) {
    return reviewService.create(review);
}

From source file:edu.eci.arsw.msgbroker.PuntosController.java

@RequestMapping(method = RequestMethod.POST)
public ResponseEntity<?> manejadorPostRecursoXX(@RequestBody Point pt) {
    try {//from  ww w .j a  v  a2  s.c  o  m
        msgt.convertAndSend("/topic/newpoint", pt);
        mp.adicionar(pt);
        if (mp.getSize() == 4) {
            msgt.convertAndSend("/topic/newpolygon", mp.Array());
            mp.reset();
        }
        return new ResponseEntity<>(HttpStatus.CREATED);
    } catch (Exception ex) {
        Logger.getLogger(STOMPMessagesHandler.class.getName()).log(Level.SEVERE, null, ex);
        return new ResponseEntity<>("Error bla bla bla", HttpStatus.FORBIDDEN);
    }

}

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

@RequestMapping(value = "/post", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
@ResponseBody//from   w  w w . j  a  v  a2 s .c  o  m
public Post createPost(@Valid @RequestBody Post post) {
    dao.addPost(post);
    return post;
}

From source file:co.agileventure.cloud.product.rest.ProductController.java

@RequestMapping(method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public Product create(@RequestBody @Valid Product product) {
    return productService.create(product);
}

From source file:demo.FleetBulkUploadController.java

@RequestMapping(value = "/fleet", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public void upload(@RequestBody List<Location> trucks) throws Exception {
    this.repository.save(trucks);
}

From source file:rest.PartidaRestController.java

@RequestMapping(value = "/{id}", method = RequestMethod.PUT)
public ResponseEntity<?> modificarPartida(@PathVariable int id, @RequestBody InfoPartida ip) {
    logicaPartida.modificarPartida(ip, id);
    return new ResponseEntity<>(HttpStatus.CREATED);
}

From source file:com.graphaware.controller.LinkingController.java

@RequestMapping(value = "/{start}/{end}", method = RequestMethod.POST)
@ResponseStatus(HttpStatus.CREATED)
public void link(@PathVariable long start, @PathVariable long end) {
    linkingService.link(start, end);/*from   w w  w  . j  av  a2s  .  c  om*/
}