123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- package com.caimei.www.controller.unlimited;
- import com.caimei.www.controller.BaseController;
- import com.caimei.www.pojo.page.ImageLink;
- import com.caimei.www.pojo.JsonModel;
- import com.caimei.www.pojo.page.PageFloor;
- import com.caimei.www.pojo.page.ProductList;
- import com.caimei.www.service.page.HomeService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.ui.Model;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import java.util.List;
- /**
- * Description(接口已搬至spi)
- *
- * @author : Charles
- * @date : 2020/6/15
- */
- @Controller
- public class HomeController extends BaseController {
- private static final String HOME_PATH = "index";
- /** 错误页面 */
- private static final String ERROR_PATH = "error/404";
- private static final String SEARCH_CHILDREN = "error/search_children";
- private HomeService homeService;
- @Autowired
- public void setHomeService(HomeService homeService) {
- this.homeService = homeService;
- }
- /**
- * 首页页面路径
- * @param model
- * @return
- */
- @GetMapping("/index.html")
- public String home(final Model model) {
- model.addAttribute("msg", "首页");
- return HOME_PATH;
- }
- /**
- * 404
- */
- @GetMapping("/404.html")
- public String errorPage(final Model model) {
- model.addAttribute("msg", "404页面");
- return ERROR_PATH;
- }
- /**
- * 腾讯公益
- */
- @GetMapping("/search_children.html")
- public String searchChildren(final Model model) {
- model.addAttribute("msg", "腾讯公益");
- return SEARCH_CHILDREN;
- }
- /**
- * 首页轮播图列表
- * @return
- */
- @GetMapping("/home/banner")
- @ResponseBody
- public JsonModel<List<ImageLink>> getHomeBanners() {
- return homeService.getHomeBanners();
- }
- /**
- * 首页推荐专区
- * @return
- */
- /*
- @GetMapping("/home/recommend")
- @ResponseBody
- public JsonModel<List<ProductList>> getRecommendProducts() {
- return homeService.getRecommendProducts();
- }
- */
- /**
- * 首页楼层专题数据
- * @return
- */
- @GetMapping("/home/floor")
- @ResponseBody
- public JsonModel<List<PageFloor>> getHomePageFloorData() {
- return homeService.getHomePageFloorData();
- }
- /**
- * 首页左侧广告图
- * @return
- */
- @GetMapping("/home/advertising")
- @ResponseBody
- public JsonModel<List<ImageLink>> getAdvertising() {
- return homeService.getAdvertising();
- }
- }
|