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