소스 검색

云上美博会路由配置

Aslee 3 년 전
부모
커밋
5e828c6788

+ 15 - 0
src/main/java/com/caimei/www/controller/unlimited/ProductController.java

@@ -30,6 +30,7 @@ public class ProductController extends BaseController {
     private static final String INSTRUMENT_LIST_PATH = "product/instruelist";
     private static final String QUALITY_AUTHORRIZE_PATH = "product/qualityauthorize";
     private static final String ACTIVITY_TOP_PATH = "activity/activityTopic";
+    private static final String CLOUD_BEAUTY_PATH = "activity/beautyTopic";
     /**
      * 美博会专题页
      */
@@ -150,4 +151,18 @@ public class ProductController extends BaseController {
         return ACTIVITY_TOP_PATH;
     }
 
+    /**
+     * 云上美博会
+     */
+    @GetMapping("/product/beauty-{id}.html")
+    public String getCloudBeautyPath(final Model model, @PathVariable("id") Integer id) {
+        // 活动专题页
+        Integer pageId = singlePageService.getBeautyPageIdById(id);
+        if (pageId == null) {
+            return super.errorPath();
+        }
+        model.addAttribute("pageId", id);
+        return CLOUD_BEAUTY_PATH;
+    }
+
 }

+ 5 - 0
src/main/java/com/caimei/www/mapper/SinglePageDao.java

@@ -101,4 +101,9 @@ public interface SinglePageDao {
     Integer getActivityPageIdById(Integer id);
 
     Integer getPageTypeSort(Integer pageId);
+
+    /**
+     * 云上美博会
+     */
+    Integer getBeautyPageIdById(Integer id);
 }

+ 5 - 0
src/main/java/com/caimei/www/service/page/SinglePageService.java

@@ -40,4 +40,9 @@ public interface SinglePageService {
     Integer getActivityPageIdById(Integer id);
 
     Integer getPageTypeSort(Integer pageId);
+
+    /**
+     * 云上美博会
+     */
+    Integer getBeautyPageIdById(Integer id);
 }

+ 7 - 0
src/main/java/com/caimei/www/service/page/impl/SinglePageServiceImpl.java

@@ -132,4 +132,11 @@ public class SinglePageServiceImpl implements SinglePageService {
         return singlePageDao.getPageTypeSort(pageId);
     }
 
+    @Override
+    public Integer getBeautyPageIdById(Integer id) {
+        if (id == null) {
+            return null;
+        }
+        return singlePageDao.getBeautyPageIdById(id);
+    }
 }

+ 6 - 0
src/main/resources/mapper/SinglePageMapper.xml

@@ -95,5 +95,11 @@
         select typeSort from cm_page
         where id = #{pageId} and enabledStatus = '1'
     </select>
+    <select id="getBeautyPageIdById" resultType="java.lang.Integer">
+        select id from cm_page a
+        where
+            a.type=7 and a.enabledStatus=1
+          and a.id=#{id}
+    </select>
 
 </mapper>