@RequestMapping(value = "/collector/item/{id}", method = GET, produces = JSON) public ResponseEntity<CollectorItem> getCollectorItem(@PathVariable ObjectId id) { return ResponseEntity.ok(collectorService.getCollectorItem(id)); }
@RequestMapping(value = "/collector/item/type/{collectorType}", method = GET, produces = JSON) public List<CollectorItem> collectorItemsByType(@PathVariable CollectorType collectorType) { return collectorService.collectorItemsByType(collectorType); }
@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())); }