| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- 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.ResponseBody;
- import org.springframework.web.bind.annotation.RestController;
- import com.goafanti.app.service.AppHomePageService;
- import com.goafanti.business.service.JtBusinessService;
- import com.goafanti.comment.bo.CommentResult;
- import com.goafanti.comment.service.CommentService;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.constant.AFTConstants;
- import com.goafanti.common.constant.ErrorConstants;
- import com.goafanti.common.controller.BaseApiController;
- import com.goafanti.common.utils.StringUtils;
- @RestController
- @RequestMapping(path = "/open/app/home")
- public class OpenAppHomeController extends BaseApiController{
- @Resource
- private AppHomePageService appHomePageService;
- @Resource
- private JtBusinessService jtBusinessService;
- @Resource
- private CommentService commentService;
-
-
- /**App首页轮播图、导航、知产*/
- @RequestMapping(value = "/getHomePageData", method = RequestMethod.GET)
- public Result getHomePageData(HttpServletRequest request){
- Result res = new Result();
- res.setData(appHomePageService.getAppHomePage(request));
- 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;
- }
- /**
- * 项目列表
- * @param topId
- * @param secondId
- * @param name
- * @param pageSize
- * @param pageNo
- * @param privateProject
- * @param auditStatus
- * @param module
- * @param isHot
- * @param orderType
- * @param orderSort
- * @param ownerId
- * @return
- */
- @RequestMapping(value="/projectList", method=RequestMethod.GET)
- public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
- Result result=new Result();
- result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
- return result;
- }
-
- /**
- * 项目详情
- * @param id
- * @return
- */
- @RequestMapping(value="/projectdDtail",method=RequestMethod.GET)
- public Result projectdDtail(String id){
- Result result =new Result();
- if (StringUtils.isBlank(id)) {
- result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"商品ID","商品ID"));
- return result;
- }
- result.setData(jtBusinessService.getBusinessProjectDetail(id));
- return result;
- }
- /**
- * 项目评价
- * @param id
- * @return
- */
- @RequestMapping(value = "/projectdComment", method = RequestMethod.GET)
- public Result listComment(String id,Integer pageNo,Integer pageSize) {
- Result result=new Result();
- if(StringUtils.isBlank(id)) {
- result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"商品ID","商品ID"));
- }
- CommentResult commentResult=new CommentResult();
- commentResult.setPositiveCommentCount(commentService.getCommentCount(0, id));
- commentResult.setOrdinaryCommentCount(commentService.getCommentCount(1, id));
- commentResult.setNegativeCommentCount(commentService.getCommentCount(2, id));
- commentResult.setComments(commentService.searchComment(id, pageNo, pageSize));
- result.setData(commentResult);
- return result;
- }
-
-
- }
|