Skip to content

Commit

Permalink
Implement FindBooksUseCase with FindBooksPort interface
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasHavers committed Nov 14, 2018
1 parent ec8a571 commit 22b6bd6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/catalogservice/application/FindBooksPort.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package catalogservice.application;

import catalogservice.domain.Book;
import io.reactivex.Flowable;

public interface FindBooksPort {
Flowable<Book> books();
}
11 changes: 10 additions & 1 deletion src/main/java/catalogservice/application/FindBooksUseCase.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
package catalogservice.application;

import catalogservice.domain.Book;
import io.reactivex.Flowable;
import lombok.RequiredArgsConstructor;

import javax.inject.Singleton;

@Singleton
@RequiredArgsConstructor
public class FindBooksUseCase {
private final FindBooksPort findBooksPort;

}
public Flowable<Book> invoke() {
return findBooksPort.books();
}
}
20 changes: 20 additions & 0 deletions src/main/java/catalogservice/domain/Book.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package catalogservice.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class Book {
private String title;
private String author;
private String additionalAuthors;
private String isbn;
private String isbn13;
private Integer numberOfPages;
private Integer yearPublished;
private Integer originalPublicationYear;
private Long goodreadsBookId;
}

0 comments on commit 22b6bd6

Please sign in to comment.