| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package com.goafanti.app.controller;
- import javax.annotation.Resource;
- import javax.servlet.http.HttpServletRequest;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RequestMethod;
- import org.springframework.web.bind.annotation.RestController;
- import com.goafanti.app.service.AppHomePageService;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.controller.BaseApiController;
- @RestController
- @RequestMapping(path = "open/app/home")
- public class OpenAppHomeController extends BaseApiController{
- @Resource
- private AppHomePageService appHomePageService;
-
-
- /**App首页轮播图、导航、知产*/
- @RequestMapping(value = "/getHomePageData", method = RequestMethod.GET)
- public Result getHomePageData(HttpServletRequest request){
- Result res = new Result();
- String path = request.getContextPath();
- String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
- System.out.println("path:-------------------"+path);
- System.out.println("basePath:-------------------"+basePath);
- res.setData(appHomePageService.getAppHomePage());
- return res;
- }
-
- /**技淘推荐*/
- @RequestMapping(value = "/getHomeRecommended", method = RequestMethod.GET)
- public Result getHomeRecommended(Integer type){
- Result res = new Result();
- if (null==type||type>3||type<0) {
- res.getError().add(buildError( "类型错误", "类型错误"));
- return res;
- }
- res.setData(appHomePageService.getHomeRecommended(type));
- return res;
- }
-
-
- }
|