|
|
@@ -3,9 +3,14 @@ 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;
|
|
|
@@ -14,7 +19,9 @@ 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")
|
|
|
@@ -28,7 +35,12 @@ public class OpenAppHomeController extends BaseApiController{
|
|
|
private JtTagService jtTagService;
|
|
|
@Resource
|
|
|
private BannersService bannersService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private AchievementService achievementService;
|
|
|
+ @Resource
|
|
|
+ private DemandService demandService;
|
|
|
+ @Resource
|
|
|
+ private GlobalSearchService globalSearchService;
|
|
|
|
|
|
|
|
|
/**技淘推荐*//*
|
|
|
@@ -155,6 +167,36 @@ public class OpenAppHomeController extends BaseApiController{
|
|
|
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;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|