|
@@ -4,16 +4,13 @@ import com.caimei.www.controller.BaseController;
|
|
|
import com.caimei.www.pojo.JsonModel;
|
|
|
import com.caimei.www.pojo.page.ImageLink;
|
|
|
import com.caimei.www.pojo.page.PageContent;
|
|
|
-import com.caimei.www.pojo.page.PageFloor;
|
|
|
import com.caimei.www.service.page.SinglePageService;
|
|
|
-import com.github.pagehelper.PageInfo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
-import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import reactor.core.publisher.Mono;
|
|
|
|
|
@@ -29,20 +26,33 @@ import java.util.List;
|
|
|
*/
|
|
|
@Controller
|
|
|
public class SinglePageController extends BaseController {
|
|
|
- /** 找产品/找仪器/找项目 */
|
|
|
- private static final String TOPIC_PATH = "single-page/topic";
|
|
|
- /** 专题活动列表页 */
|
|
|
- private static final String PROMOTIONS_PATH = "single-page/promotions";
|
|
|
- /** 自由页面 */
|
|
|
- private static final String FREE_PAGE_PATH = "single-page/page";
|
|
|
- /** 采美直播页面 */
|
|
|
- private static final String LIVE_PATH = "single-page/live";
|
|
|
- /** 品牌招商介绍页 */
|
|
|
- private static final String INVESTMENT_PATH = "single-page/investment";
|
|
|
- /** 维修保养介绍页 */
|
|
|
- private static final String REPAIR_PATH = "single-page/repair";
|
|
|
+ /**
|
|
|
+ * 找产品/找仪器/找项目
|
|
|
+ */
|
|
|
+ private static final String TOPIC_PATH = "single-page/topic";
|
|
|
+ /**
|
|
|
+ * 专题活动列表页
|
|
|
+ */
|
|
|
+ private static final String PROMOTIONS_PATH = "single-page/promotions";
|
|
|
+ /**
|
|
|
+ * 自由页面
|
|
|
+ */
|
|
|
+ private static final String FREE_PAGE_PATH = "single-page/page";
|
|
|
+ /**
|
|
|
+ * 采美直播页面
|
|
|
+ */
|
|
|
+ private static final String LIVE_PATH = "single-page/live";
|
|
|
+ /**
|
|
|
+ * 品牌招商介绍页
|
|
|
+ */
|
|
|
+ private static final String INVESTMENT_PATH = "single-page/investment";
|
|
|
+ /**
|
|
|
+ * 维修保养介绍页
|
|
|
+ */
|
|
|
+ private static final String REPAIR_PATH = "single-page/repair";
|
|
|
|
|
|
private SinglePageService singlePageService;
|
|
|
+
|
|
|
@Autowired
|
|
|
public void setSinglePageService(SinglePageService singlePageService) {
|
|
|
this.singlePageService = singlePageService;
|
|
@@ -53,8 +63,12 @@ public class SinglePageController extends BaseController {
|
|
|
*/
|
|
|
@GetMapping("/topic-{id}.html")
|
|
|
public String topic(final Model model, @PathVariable("id") Integer id) {
|
|
|
+ // 二手商品【旧】
|
|
|
+ if (Integer.valueOf("189").equals(id)) {
|
|
|
+ return "redirect:/flea-market/list.html";
|
|
|
+ }
|
|
|
PageContent topicPage = singlePageService.getTopicPageById(id);
|
|
|
- if (topicPage == null){
|
|
|
+ if (topicPage == null) {
|
|
|
return super.errorPath();
|
|
|
}
|
|
|
model.addAttribute("pageData", topicPage);
|
|
@@ -75,7 +89,7 @@ public class SinglePageController extends BaseController {
|
|
|
@GetMapping("/page-{id}.html")
|
|
|
public String freePage(final Model model, @PathVariable("id") Integer id) {
|
|
|
PageContent freePage = singlePageService.getFreePageById(id);
|
|
|
- if (freePage == null){
|
|
|
+ if (freePage == null) {
|
|
|
return super.errorPath();
|
|
|
}
|
|
|
model.addAttribute("pageData", freePage);
|
|
@@ -88,7 +102,7 @@ public class SinglePageController extends BaseController {
|
|
|
@GetMapping("/live.html")
|
|
|
public String livePage(final Model model) {
|
|
|
PageContent livePage = singlePageService.getLivePageData();
|
|
|
- if (livePage == null){
|
|
|
+ if (livePage == null) {
|
|
|
return super.errorPath();
|
|
|
}
|
|
|
model.addAttribute("pageData", livePage);
|