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