|
@@ -1,8 +1,10 @@
|
|
|
package com.caimei.www.controller.unlimited;
|
|
|
|
|
|
import com.caimei.www.controller.BaseController;
|
|
|
+import com.caimei.www.pojo.page.PageContent;
|
|
|
import com.caimei.www.pojo.page.ProductDetail;
|
|
|
import com.caimei.www.service.page.ProductService;
|
|
|
+import com.caimei.www.service.page.SinglePageService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
@@ -34,11 +36,18 @@ public class ProductController extends BaseController {
|
|
|
|
|
|
private ProductService productService;
|
|
|
|
|
|
+ private SinglePageService singlePageService;
|
|
|
+
|
|
|
@Autowired
|
|
|
public void setProductService(ProductService productService) {
|
|
|
this.productService = productService;
|
|
|
}
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public void setSinglePageService(SinglePageService singlePageService) {
|
|
|
+ this.singlePageService = singlePageService;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 商品分类列表/搜索结果 页面
|
|
|
*/
|
|
@@ -73,7 +82,11 @@ public class ProductController extends BaseController {
|
|
|
* 仪器页
|
|
|
*/
|
|
|
@GetMapping("/product/instrument.html")
|
|
|
- public String instrument() {
|
|
|
+ public String instrument(Integer id) {
|
|
|
+ Integer pageId = singlePageService.getInstrumentPageIdById(id);
|
|
|
+ if (pageId == null) {
|
|
|
+ return super.errorPath();
|
|
|
+ }
|
|
|
return INSTRUMENT_PAGE_PATH;
|
|
|
}
|
|
|
|
|
@@ -81,7 +94,11 @@ public class ProductController extends BaseController {
|
|
|
* 美体节活动页
|
|
|
*/
|
|
|
@GetMapping("/product/temporary.html")
|
|
|
- public String temporary() {
|
|
|
+ public String temporary(Integer id) {
|
|
|
+ Integer pageId = singlePageService.getInstrumentPageIdById(id);
|
|
|
+ if (pageId == null) {
|
|
|
+ return super.errorPath();
|
|
|
+ }
|
|
|
return TEMPORARY_PAGE_PATH;
|
|
|
}
|
|
|
|
|
@@ -115,6 +132,10 @@ public class ProductController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping("activity/activityTopic.html")
|
|
|
public String activityTopic(final Model model, Integer id) {
|
|
|
+ Integer pageId = singlePageService.getActivityPageIdById(id);
|
|
|
+ if (pageId == null) {
|
|
|
+ return super.errorPath();
|
|
|
+ }
|
|
|
model.addAttribute("pageId", id);
|
|
|
return ACTIVITY_TOP_PATH;
|
|
|
}
|