|
|
@ -1,6 +1,6 @@ |
|
|
|
package com.jesuspinar.booksearch.service; |
|
|
|
|
|
|
|
import com.jesuspinar.booksearch.dao.BookDao; |
|
|
|
import com.jesuspinar.booksearch.dao.IBookDao; |
|
|
|
import com.jesuspinar.booksearch.model.Book; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -14,7 +14,7 @@ import java.util.stream.Collectors; |
|
|
|
public class BookService implements IBookService{ |
|
|
|
|
|
|
|
@Autowired |
|
|
|
BookDao bookDao; |
|
|
|
IBookDao iBookDao; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
IBookQueryService queryService; |
|
|
@ -24,7 +24,7 @@ public class BookService implements IBookService{ |
|
|
|
public Collection<String> findAllGenres() { |
|
|
|
List<String> result = null; |
|
|
|
|
|
|
|
result = bookDao.findAll() |
|
|
|
result = iBookDao.findAll() |
|
|
|
.stream() |
|
|
|
.map(book -> book.getGenre()) |
|
|
|
//.flatMap(l -> Stream.of(l))//TODO: Check this if other java version! |
|
|
@ -52,6 +52,6 @@ public class BookService implements IBookService{ |
|
|
|
|
|
|
|
@Override |
|
|
|
public Collection<Book> findAll() { |
|
|
|
return bookDao.findAll(); |
|
|
|
return iBookDao.findAll(); |
|
|
|
} |
|
|
|
} |