diff --git a/book-rent/src/main/java/com/example/demo/controller/BookController.java b/book-rent/src/main/java/com/example/demo/controller/BookController.java index 5344892..0196193 100644 --- a/book-rent/src/main/java/com/example/demo/controller/BookController.java +++ b/book-rent/src/main/java/com/example/demo/controller/BookController.java @@ -1,5 +1,33 @@ package com.example.demo.controller; -public class BookController { +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestParam; +import com.example.demo.service.BookService; + + +/** BOOK-01:書籍検索(bookList.html) */ +@Controller +public class BookController { + private final BookService bookService; + + public BookController(BookService bookService) { + this.bookService = bookService; + } + + /** メニューの「書籍一覧」=条件なし(全件)、検索ボタン=条件付きで同じURLを使う */ + @GetMapping("/books") + public String list(@RequestParam(defaultValue = "") String nmBook, + @RequestParam(defaultValue = "") String publisher, + @RequestParam(defaultValue = "") String note, + Model model) { + model.addAttribute("books", bookService.searchLendable(nmBook, publisher, note)); + // 検索条件を保持 + model.addAttribute("nmBook", nmBook); + model.addAttribute("publisher", publisher); + model.addAttribute("note", note); + return "bookList"; + } } diff --git a/book-rent/src/main/resources/templates/applicationConfirm.html b/book-rent/src/main/resources/templates/applicationConfirm.html deleted file mode 100644 index cc28384..0000000 --- a/book-rent/src/main/resources/templates/applicationConfirm.html +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - 書籍貸出申請画面 - - - - - - -
- -
- - - - - - - - - 申請 -
蔵書ID - - 書籍名 - - 貸出日 - - 返却予定日 - -
- 申請情報入力 - - - \ No newline at end of file diff --git a/book-rent/src/main/resources/templates/bookConfirm.html b/book-rent/src/main/resources/templates/bookConfirm.html new file mode 100644 index 0000000..c9d41d0 --- /dev/null +++ b/book-rent/src/main/resources/templates/bookConfirm.html @@ -0,0 +1,42 @@ + + + + + 書籍情報確認 + + + +
+
+

書籍情報確認

+
+

書籍登録

+ + + + + + +
ISBN
書籍名
書籍名よみ
出版社
特記事項
+
+ + + + + + + +
+
+ + + + + + + +
+
+
+ + diff --git a/book-rent/src/main/resources/templates/bookInput.html b/book-rent/src/main/resources/templates/bookInput.html new file mode 100644 index 0000000..dddd0f0 --- /dev/null +++ b/book-rent/src/main/resources/templates/bookInput.html @@ -0,0 +1,34 @@ + + + + + 書籍情報入力 + + + +
+
+

書籍情報入力

+
+
+
+

書籍登録

+
+ + + + + + + + + + + +

+ 書籍一覧に戻る

+
+
+
+ + diff --git a/book-rent/src/main/resources/templates/bookList.html b/book-rent/src/main/resources/templates/bookList.html new file mode 100644 index 0000000..0193cfc --- /dev/null +++ b/book-rent/src/main/resources/templates/bookList.html @@ -0,0 +1,67 @@ + + + + + + 書籍一覧 + + + + +
+
+

書籍一覧

+
+
+
+ + + + + + +

+ メニューに戻る + 書籍新規登録 +

+
+
+ +
+

検索結果

+

該当する書籍はありません。

+ + + + + + + + + + + + + + + + + + + + + + + +
蔵書IDISBN書籍名書籍名よみ出版社特記事項操作
+ + 貸出申請 + 編集 +
+
+
+ + + \ No newline at end of file diff --git a/book-rent/src/main/resources/templates/complete.html b/book-rent/src/main/resources/templates/complete.html new file mode 100644 index 0000000..9e84135 --- /dev/null +++ b/book-rent/src/main/resources/templates/complete.html @@ -0,0 +1,19 @@ + + + + + 完了 + + + +
+
+

完了

+
+

+ 戻る + メニューに戻る +

+
+ + diff --git a/book-rent/src/main/resources/templates/loanApplyConfirm.html b/book-rent/src/main/resources/templates/loanApplyConfirm.html new file mode 100644 index 0000000..23bbeb3 --- /dev/null +++ b/book-rent/src/main/resources/templates/loanApplyConfirm.html @@ -0,0 +1,38 @@ + + + + + 書籍貸出申請確認 + + + +
+
+

書籍貸出申請確認

+
+ + + + + +
書籍名
ISBN
出版社
特記事項
+ + + +
貸出日
返却予定日
+
+ + + + +
+
+ + + + +
+
+
+ + diff --git a/book-rent/src/main/resources/templates/loanApplyInput.html b/book-rent/src/main/resources/templates/loanApplyInput.html new file mode 100644 index 0000000..730938d --- /dev/null +++ b/book-rent/src/main/resources/templates/loanApplyInput.html @@ -0,0 +1,33 @@ + + + + + 書籍貸出申請 + + + +
+
+

書籍貸出申請

+
+
+
+ + + + + +
書籍名
ISBN
出版社
特記事項
+
+ + + + + +

+ 書籍一覧に戻る

+
+
+
+ +