|
|
@@ -0,0 +1,39 @@
|
|
|
+package com.goafanti.app.controller;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+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.controller.BaseApiController;
|
|
|
+import com.goafanti.news.enums.NewsType;
|
|
|
+import com.goafanti.news.service.NewsService;
|
|
|
+
|
|
|
+@RestController
|
|
|
+@RequestMapping(path = "/api/portal/app", method = RequestMethod.GET)
|
|
|
+public class AppApiController extends BaseApiController {
|
|
|
+ @Resource
|
|
|
+ BannersService bannersService;
|
|
|
+ @Resource
|
|
|
+ private ActivityService activityService;
|
|
|
+ @Resource
|
|
|
+ NewsService newsService;
|
|
|
+
|
|
|
+ @RequestMapping(value = "/index", method = RequestMethod.GET)
|
|
|
+ public Result index() {
|
|
|
+ Map<String, Object> result = new HashMap<>();
|
|
|
+ result.put("banners", bannersService.findPortalBanners(BannersType.APP.getKey()));
|
|
|
+ result.put("activities", activityService.findPortalList(0, 3, null));
|
|
|
+ result.put("policies", newsService.findNewsList(0, NewsType.GJZC.getCode(), 3));
|
|
|
+ result.put("news", newsService.findNewsList(0, NewsType.JTDT.getCode(), 5));
|
|
|
+ return res().data(result);
|
|
|
+ }
|
|
|
+}
|