Esempio n. 1
0
 @RequestMapping(value = "/collector/item/{id}", method = GET, produces = JSON)
 public ResponseEntity<CollectorItem> getCollectorItem(@PathVariable ObjectId id) {
   return ResponseEntity.ok(collectorService.getCollectorItem(id));
 }
Esempio n. 2
0
 @RequestMapping(value = "/collector/item/type/{collectorType}", method = GET, produces = JSON)
 public List<CollectorItem> collectorItemsByType(@PathVariable CollectorType collectorType) {
   return collectorService.collectorItemsByType(collectorType);
 }
Esempio n. 3
0
 @RequestMapping(value = "/collector/item", method = POST, consumes = JSON, produces = JSON)
 public ResponseEntity<CollectorItem> createCollectorItem(
     @Valid @RequestBody CollectorItemRequest request) {
   return ResponseEntity.status(HttpStatus.CREATED)
       .body(collectorService.createCollectorItem(request.toCollectorItem()));
 }