From 952f6ff37b57adcfd5b057ac7e0c43bb9697a01f Mon Sep 17 00:00:00 2001
From: Hentua <wangdoubleone@gmail.com>
Date: Fri, 21 Apr 2023 00:59:24 +0800
Subject: [PATCH] 咨询

---
 src/main/java/cc/mrbird/febs/mall/controller/ViewNewsController.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/mall/controller/ViewNewsController.java b/src/main/java/cc/mrbird/febs/mall/controller/ViewNewsController.java
index b30b048..4b09b97 100644
--- a/src/main/java/cc/mrbird/febs/mall/controller/ViewNewsController.java
+++ b/src/main/java/cc/mrbird/febs/mall/controller/ViewNewsController.java
@@ -12,6 +12,7 @@
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
 
 /**
  * @author wzy
@@ -34,13 +35,21 @@
         return FebsUtil.view("modules/news/newsInfoList");
     }
 
+
+    @GetMapping("knowledge")
+    @RequiresPermissions("newsInfoList:view")
+    public String knowledge() {
+        return FebsUtil.view("modules/news/knowledgeList");
+    }
+
     /**
      * 新闻中心-新增
      * @return
      */
-    @GetMapping("newsInfoAdd")
+    @GetMapping("newsInfoAdd/{code}")
     @RequiresPermissions("newsInfoAdd:add")
-    public String newsInfoAdd() {
+    public String newsInfoAdd(@PathVariable("code") String code, Model model) {
+        model.addAttribute("code", code);
         return FebsUtil.view("modules/news/newsInfoAdd");
     }
 
@@ -50,10 +59,11 @@
      * @param model
      * @return
      */
-    @GetMapping("newsInfoUpdate/{id}")
+    @GetMapping("newsInfoUpdate/{id}/{code}")
     @RequiresPermissions("newsInfoUpdate:update")
-    public String newsInfoUpdate(@PathVariable long id, Model model) {
+    public String newsInfoUpdate(@PathVariable("id") long id, @PathVariable("code") String code, Model model) {
         MallNewsInfo data = mallNewsInfoService.getNewsInfoById(id);
+        model.addAttribute("code", code);
         model.addAttribute("newsInfo", data);
         return FebsUtil.view("modules/news/newsInfoUpdate");
     }

--
Gitblit v1.9.1