|
@@ -16,37 +16,21 @@ import org.thymeleaf.spring5.context.webflux.ReactiveDataDriverContextVariable;
|
|
|
* @date : 2020/6/12
|
|
|
*/
|
|
|
@Controller
|
|
|
-public class TestController {
|
|
|
+public class ProductController {
|
|
|
|
|
|
- private static final String INDEX_PATH= "index";
|
|
|
+ private static final String PRODUCT_LIST_PATH = "product/list";
|
|
|
+ private static final String PRODUCT_DETAIL_PATH = "product/detail";
|
|
|
|
|
|
- @RequestMapping("/")
|
|
|
- public String index(final Model model) {
|
|
|
-
|
|
|
- model.addAttribute("msg", "你好33333333");
|
|
|
-
|
|
|
- return INDEX_PATH;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- @GetMapping("/index.html")
|
|
|
+ @GetMapping("/product/list.html")
|
|
|
public String hello(final Model model) {
|
|
|
- model.addAttribute("msg", "你好222222");
|
|
|
- return INDEX_PATH;
|
|
|
+ model.addAttribute("msg", "商品列表");
|
|
|
+ return PRODUCT_LIST_PATH;
|
|
|
}
|
|
|
|
|
|
- @GetMapping("/product.html")
|
|
|
+ @GetMapping("/product/detail.html")
|
|
|
public String listPage(final Model model, @RequestParam("pid") Integer productId) {
|
|
|
model.addAttribute("msg", productId);
|
|
|
- return INDEX_PATH;
|
|
|
+ return PRODUCT_DETAIL_PATH;
|
|
|
}
|
|
|
|
|
|
|