|
@@ -8,6 +8,8 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
+import static java.util.Collections.emptyList;
|
|
|
|
|
+
|
|
|
@Slf4j
|
|
@Slf4j
|
|
|
@Service
|
|
@Service
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
@@ -16,9 +18,11 @@ public class StockService {
|
|
|
private StockRepository repository;
|
|
private StockRepository repository;
|
|
|
|
|
|
|
|
public List<Quote> get(String query) {
|
|
public List<Quote> get(String query) {
|
|
|
- return query == null
|
|
|
|
|
- ? repository.findAll()
|
|
|
|
|
- : repository.findLike(query);
|
|
|
|
|
|
|
+ if (query == null) {
|
|
|
|
|
+ return emptyList();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return repository.findLike(query);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Quote getByCode(String code) {
|
|
public Quote getByCode(String code) {
|