|
|
@@ -27,14 +27,14 @@ public class StockController {
|
|
|
private final StockService service;
|
|
|
|
|
|
@GetMapping
|
|
|
- public ResponseEntity<List<Quote>> getAll() {
|
|
|
- List<Quote> response = service.get();
|
|
|
+ public ResponseEntity<List<Quote>> getAll(@RequestParam(value = "q", required = false) String query) {
|
|
|
+ List<Quote> response = service.get(query);
|
|
|
return ResponseEntity.ok(response);
|
|
|
}
|
|
|
|
|
|
@GetMapping("{code}")
|
|
|
public ResponseEntity<Quote> getByCode(@PathVariable String code) {
|
|
|
- Quote response = service.get(code.toUpperCase());
|
|
|
+ Quote response = service.getByCode(code.toUpperCase());
|
|
|
return ResponseEntity.ok(response);
|
|
|
}
|
|
|
|