Skip to content

Commit

Permalink
feat: book domain
Browse files Browse the repository at this point in the history
  • Loading branch information
becooq81 committed Aug 15, 2024
1 parent 3b441fc commit 2c94978
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 318 deletions.
70 changes: 0 additions & 70 deletions src/main/java/org/poolc/api/book/controller/BookController.java

This file was deleted.

48 changes: 33 additions & 15 deletions src/main/java/org/poolc/api/book/domain/Book.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,32 @@ public class Book extends TimestampEntity {
@JoinColumn(name = "borrower", referencedColumnName = "UUID")
private Member borrower = null;

@Column(name = "title", nullable = false, length = 1024)
@Column(name = "title", nullable = false)
private String title;

@Column(name = "author", nullable = false, length = 1024)
private String author;
@Column(name = "link")
private String link;

@Column(name = "image_url", length = 1024)
@Column(name = "image_url")
private String imageURL;

@Column(name = "info", length = 1024)
private String info;
@Column(name = "author", nullable = false)
private String author;

@Column(name = "description")
private String description;

@Column(name = "discount")
private int discount;

@Column(name = "isbn")
private String isbn;

@Column(name = "publisher")
private String publisher;

@Column(name = "published_date")
private String publishedData;

@Column(name = "borrow_date")
private LocalDate borrowDate;
Expand All @@ -48,11 +63,20 @@ public class Book extends TimestampEntity {
protected Book() {
}

public Book(String title, String author, String imageURL, String info, BookStatus status) {
public Book(Long id, Member borrower, String title, String link, String imageURL, String author, String description,
int discount, String isbn, String publisher, String publishedData, LocalDate borrowDate, BookStatus status) {
this.id = id;
this.borrower = borrower;
this.title = title;
this.author = author;
this.link = link;
this.imageURL = imageURL;
this.info = info;
this.author = author;
this.description = description;
this.discount = discount;
this.isbn = isbn;
this.publisher = publisher;
this.publishedData = publishedData;
this.borrowDate = borrowDate;
this.status = status;
}

Expand All @@ -68,10 +92,4 @@ public void returnBook() {
this.borrower = null;
}

public void update(String title, String author, String imageURL, String info) {
this.title = title;
this.author = author;
this.imageURL = imageURL;
this.info = info;
}
}
8 changes: 8 additions & 0 deletions src/main/java/org/poolc/api/book/domain/BookBorrower.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.poolc.api.book.domain;

public class BookBorrower {
// maps book with user who borrowed it
private Long bookId;
private Long userId;

}
5 changes: 5 additions & 0 deletions src/main/java/org/poolc/api/book/domain/BorrowStatus.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.poolc.api.book.domain;

public enum BorrowStatus {
BORROWED, RETURNED, EXTENDED, OVERDUE
}
21 changes: 0 additions & 21 deletions src/main/java/org/poolc/api/book/dto/BookRequest.java

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/java/org/poolc/api/book/dto/BookResponse.java

This file was deleted.

104 changes: 0 additions & 104 deletions src/main/java/org/poolc/api/book/service/BookService.java

This file was deleted.

20 changes: 0 additions & 20 deletions src/main/java/org/poolc/api/book/vo/BookCreateValues.java

This file was deleted.

20 changes: 0 additions & 20 deletions src/main/java/org/poolc/api/book/vo/BookUpdateValues.java

This file was deleted.

17 changes: 0 additions & 17 deletions src/main/java/org/poolc/api/book/vo/BorrowerValues.java

This file was deleted.

Loading

0 comments on commit 2c94978

Please sign in to comment.