| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- package com.goafanti.app.controller;
- import java.util.HashMap;
- import java.util.Map;
- 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.achievement.service.AchievementService;
- import com.goafanti.banners.service.BannersService;
- import com.goafanti.business.service.JtBusinessService;
- import com.goafanti.business.service.JtTagService;
- import com.goafanti.comment.bo.CommentResult;
- import com.goafanti.comment.service.CommentService;
- import com.goafanti.common.bo.Result;
- import com.goafanti.common.constant.ErrorConstants;
- import com.goafanti.common.controller.BaseApiController;
- import com.goafanti.common.service.GlobalSearchService;
- import com.goafanti.common.utils.StringUtils;
- import com.goafanti.demand.service.DemandService;
- @RestController
- @RequestMapping(path = "/open/app/home")
- public class OpenAppHomeController extends BaseApiController{
-
- @Resource
- private JtBusinessService jtBusinessService;
- @Resource
- private CommentService commentService;
- @Resource
- private JtTagService jtTagService;
- @Resource
- private BannersService bannersService;
- @Resource
- private AchievementService achievementService;
- @Resource
- private DemandService demandService;
- @Resource
- private GlobalSearchService globalSearchService;
-
-
- /**技淘推荐*//*
- @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 tag,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(tag,topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
- return result;
- }
-
- /**
- * 项目详情
- * @param id
- * @return
- */
- @RequestMapping(value="/projectDetail",method=RequestMethod.GET)
- public Result projectDetail(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 = "/projectComment", 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;
- }
- /**
- * 赚钱更多分类
- * @return
- */
- @RequestMapping(value = "/categoryList" , method = RequestMethod.GET)
- public Result categoryList() {
- Result result=new Result();
- result.setData(jtBusinessService.makeMoneyCategoryList());
- return result;
- }
-
- /**
- * 知识产权更多分类
- * @return
- */
- @RequestMapping(value = "/getCategoryList" , method = RequestMethod.GET)
- public Result getCategoryList(Integer module) {
- Result result=new Result();
- result.setData(jtBusinessService.getCategoryBoList(module));
- return result;
- }
- /**
- * 赚钱首页推荐运用
- * @return
- */
- @RequestMapping(value = "/recommendedApplication" , method = RequestMethod.GET)
- public Result recommendedApplication(String apiUrl,Integer pageNo,Integer pageSize) {
- Result result=new Result();
- if (null==pageNo)pageNo=1;
- if (null==pageSize)pageSize=3;
- Map<String, Object> map=new HashMap<>();
- //1 赚钱数据 2首页数据
- map.put("recommended", jtBusinessService.recommendedApplication(null,pageNo,pageSize));
- map.put("tag", jtTagService.selectListJtTag(null, 1, 99));
-
- map.put("homeImg", bannersService.findBannersList( apiUrl,1, 1, 1));
- result.setData(map);
- return result;
- }
- /**
- * 首页数据
- * @return
- */
- @RequestMapping(value = "/getHomeData" , method = RequestMethod.GET)
- public Result getHomeData(String apiUrl,Integer pageNo,Integer pageSize) {
- Result result=new Result();
- if (null==pageNo)pageNo=1;
- if (null==pageSize)pageSize=3;
- Map<String, Object> map=new HashMap<>();
- //1 赚钱数据 2首页数据
- map.put("recommended", jtBusinessService.recommendedApplication(null,pageNo,pageSize));
- map.put("homeImg", bannersService.findBannersList( apiUrl,1, 3, 1));
- result.setData(map);
- return result;
- }
- /**
- * 交易首页
- * @return
- */
- @RequestMapping(value = "/getTransactionData" , method = RequestMethod.GET)
- public Result getTransactionData(String apiUrl,Integer pageNo,Integer pageSize,HttpServletRequest request) {
- Result result=new Result();
- if (null==pageNo)pageNo=1;
- if (null==pageSize)pageSize=3;
- Map<String, Object> map=new HashMap<>();
- String url = com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
- map.put("homeImg", bannersService.findBannersList( apiUrl,1, 1, 1));
- // map.put("achievement", achievementService.getHotAchievements(3, url,"app_achievement_trading_index"));
- // map.put("demand", demandService.getHotDemand(3, url, "app_demand_trading_index",0));
- map.put("achievement", achievementService.getHotAchievements(3, url,"web_index"));
- map.put("demand", demandService.getHotDemand(3, url, "web_index",0));
- result.setData(map);
- return result;
- }
-
- /**
- * 全局搜索
- */
- @RequestMapping(value = "/AchievementsDemandSearch", method = RequestMethod.GET)
- @ResponseBody
- public Result AchievementsDemandSearch(String name,Integer pageSize,Integer pageNo) {
- Result res = new Result();
- res.setData(globalSearchService.AchievementsDemandSearchList(name,pageNo,pageSize));
- return res;
- }
-
-
-
- }
|