Selaa lähdekoodia

项目仪器页面静态化part4

chao 4 vuotta sitten
vanhempi
commit
b4f46493da

+ 12 - 4
src/main/java/com/caimei/www/controller/RedirectController.java

@@ -88,9 +88,9 @@ public class RedirectController {
     public String classificationDetails(@PathVariable("id") Integer id,String name) {
         // 美体节活动页
         if (id == 301) {
-            return "redirect:/product/temporary.html?id=" + id + "&name=" + name;
+            return "redirect:/product/activity-301.html";
         }
-        return "redirect:/product/type-"+id+".html?name="+name;
+        return "redirect:/product/type-"+id+".html";
     }
     @GetMapping("/product/instrument.html")
     public String classificationDetails2(Integer id) {
@@ -101,8 +101,16 @@ public class RedirectController {
      * 活动专题
      */
     @GetMapping("/cmpage/info-6-{id}.html")
-    public String activityTopics(@PathVariable("id") Integer id, String name) {
-        return "redirect:/activity/activityTopic.html?id=" + id + "&name=" + name;
+    public String activityTopics(@PathVariable("id") Integer id) {
+        return "redirect:/product/activity-"+id+".html";
+    }
+    @GetMapping("/activity/activityTopic.html")
+    public String activityTopics2(@RequestParam("id") Integer id) {
+        return "redirect:/product/activity-"+id+".html";
+    }
+    @GetMapping("/product/beautytopic.html")
+    public String activityTopics3() {
+        return "redirect:/product/beauty.html";
     }
 
     /**

+ 16 - 17
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -102,18 +102,6 @@ public class ProductController extends BaseController {
         return INSTRUMENT_PAGE_PATH;
     }
 
-    /**
-     * 美体节活动页
-     */
-    @GetMapping("/product/temporary.html")
-    public String temporary(Integer id) {
-        Integer pageId = singlePageService.getInstrumentPageIdById(id);
-        if (pageId == null) {
-            return super.errorPath();
-        }
-        return TEMPORARY_PAGE_PATH;
-    }
-
     /**
      * 商品分类列表页面
      */
@@ -125,7 +113,7 @@ public class ProductController extends BaseController {
     /**
      * 美博会专题页
      */
-    @GetMapping("/product/beautytopic.html")
+    @GetMapping("/product/beauty.html")
     public String beautytopic() {
         return BEAUTY_TOP_PATH;
     }
@@ -133,7 +121,7 @@ public class ProductController extends BaseController {
     /**
      * 正品联盟品牌授权商品详情页
      */
-    @GetMapping("product/auth/product-{id}.html")
+    @GetMapping("/product/auth/product-{id}.html")
     public String authorization(final Model model, @PathVariable("id") Integer productId) {
         model.addAttribute("productId", productId);
         return QUALITY_AUTHORRIZE_PATH;
@@ -142,13 +130,24 @@ public class ProductController extends BaseController {
     /**
      * 活动专题页
      */
-    @GetMapping("activity/activityTopic.html")
-    public String activityTopic(final Model model, Integer id) {
-        Integer pageId = singlePageService.getActivityPageIdById(id);
+    @GetMapping("/product/activity-{id}.html")
+    public String activityTopic(final Model model, @PathVariable("id") Integer id) {
+        Integer pageId = null;
+        if (id == 301) {
+            // 美体节活动页
+            pageId = singlePageService.getInstrumentPageIdById(id);
+            if (pageId == null) {
+                return super.errorPath();
+            }
+            return TEMPORARY_PAGE_PATH;
+        }
+        // 活动专题页
+        pageId = singlePageService.getActivityPageIdById(id);
         if (pageId == null) {
             return super.errorPath();
         }
         model.addAttribute("pageId", id);
         return ACTIVITY_TOP_PATH;
     }
+
 }