+ 本文档使用 探果网 发布 +
+diff --git a/tamguo-bms/src/main/java/com/tamguo/web/BookController.java b/tamguo-bms/src/main/java/com/tamguo/web/BookController.java new file mode 100644 index 0000000..7de5da4 --- /dev/null +++ b/tamguo-bms/src/main/java/com/tamguo/web/BookController.java @@ -0,0 +1,26 @@ +package com.tamguo.web; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.servlet.ModelAndView; + +import com.tamguo.modules.book.model.BookEntity; +import com.tamguo.modules.book.service.IBookService; + +@Controller +public class BookController { + + @Autowired + private IBookService iBookService; + + @RequestMapping(value="book/{id}" , method=RequestMethod.GET) + public ModelAndView book(@PathVariable String id , ModelAndView model) { + BookEntity book = iBookService.selectById(id); + model.addObject("book", book); + model.setViewName("book/book"); + return model; + } +} diff --git a/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java b/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java index 2c5f757..643d4bd 100644 --- a/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java +++ b/tamguo-bms/src/main/java/com/tamguo/web/member/BookController.java @@ -24,7 +24,7 @@ import com.tamguo.modules.book.service.IBookCategoryService; import com.tamguo.modules.book.service.IBookService; import com.tamguo.modules.book.service.IDocumentService; -@Controller +@Controller(value="memberBookController") @RequestMapping(value="member/book") public class BookController { diff --git a/tamguo-bms/src/main/resources/templates/book/book.html b/tamguo-bms/src/main/resources/templates/book/book.html new file mode 100644 index 0000000..da3d390 --- /dev/null +++ b/tamguo-bms/src/main/resources/templates/book/book.html @@ -0,0 +1,251 @@ + + +
+