|
|
@@ -5,15 +5,19 @@ import java.util.Map;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import com.goafanti.achievement.service.AchievementService;
|
|
|
import com.goafanti.activity.service.ActivityService;
|
|
|
import com.goafanti.banners.enums.BannersType;
|
|
|
import com.goafanti.banners.service.BannersService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
+import com.goafanti.demand.service.DemandService;
|
|
|
import com.goafanti.news.enums.NewsType;
|
|
|
import com.goafanti.news.service.NewsService;
|
|
|
|
|
|
@@ -21,11 +25,15 @@ import com.goafanti.news.service.NewsService;
|
|
|
@RequestMapping(path = "/api/portal/app", method = RequestMethod.GET)
|
|
|
public class AppApiController extends BaseApiController {
|
|
|
@Resource
|
|
|
- BannersService bannersService;
|
|
|
+ private BannersService bannersService;
|
|
|
@Resource
|
|
|
private ActivityService activityService;
|
|
|
@Resource
|
|
|
- NewsService newsService;
|
|
|
+ private NewsService newsService;
|
|
|
+ @Resource
|
|
|
+ private AchievementService achievementService;
|
|
|
+ @Resource
|
|
|
+ private DemandService demandService;
|
|
|
|
|
|
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
|
|
public Result index() {
|
|
|
@@ -36,4 +44,33 @@ public class AppApiController extends BaseApiController {
|
|
|
result.put("news", newsService.findNewsList(0, NewsType.JTDT.getCode(), 5));
|
|
|
return res().data(result);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技成果详情
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/achievementDetail", method = RequestMethod.GET)
|
|
|
+ public Result achievementDetail(String id) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setData(achievementService.selectAchievementDetail(id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 科技需求详情
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/demandDetail", method = RequestMethod.GET)
|
|
|
+ public Result demandDetail(String id) {
|
|
|
+ Result res = new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setData(demandService.selectDemandDetail(id));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|