|
|
@@ -1,15 +1,19 @@
|
|
|
package com.goafanti.portal.controller;
|
|
|
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
+import com.goafanti.lecture.bo.LectureListBo;
|
|
|
import com.goafanti.lecture.service.LectureService;
|
|
|
+import com.goafanti.star.bo.BigShotStarListBo;
|
|
|
import com.goafanti.star.service.StarService;
|
|
|
+import com.goafanti.user.service.UserInterestService;
|
|
|
|
|
|
/**
|
|
|
* 科技明星
|
|
|
@@ -17,18 +21,30 @@ import com.goafanti.star.service.StarService;
|
|
|
@RestController
|
|
|
public class PortalStarController extends BaseApiController {
|
|
|
@Resource
|
|
|
- private StarService starService;
|
|
|
+ private StarService starService;
|
|
|
+ @Resource
|
|
|
+ private LectureService lectureService;
|
|
|
@Resource
|
|
|
- private LectureService lectureService;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //@RequestMapping(value = "/portal/scienceTechnology/star", method = RequestMethod.GET)
|
|
|
- public ModelAndView star(){
|
|
|
+ private UserInterestService userInterestService;
|
|
|
+
|
|
|
+ // @RequestMapping(value = "/portal/scienceTechnology/star", method =
|
|
|
+ // RequestMethod.GET)
|
|
|
+ public ModelAndView star() {
|
|
|
ModelAndView mv = new ModelAndView();
|
|
|
- lectureService.listDynamic();
|
|
|
- //mv.addObject("lectureList", lectureList);
|
|
|
- mv.setViewName("/portal/scienceTechnology/bigShot");
|
|
|
+ List<LectureListBo> lectureDynamicList = lectureService.listDynamic();
|
|
|
+ mv.addObject("lectureDynamicList", lectureDynamicList);
|
|
|
+ List<BigShotStarListBo> starList = starService.listBigShotStar();
|
|
|
+ if (null != starList && starList.size() > 0) {
|
|
|
+ Integer fansNum = 0;
|
|
|
+ for (BigShotStarListBo bo : starList) {
|
|
|
+ if (StringUtils.isNotBlank(bo.getUid())) {
|
|
|
+ fansNum = userInterestService.countByToUid(bo.getUid());
|
|
|
+ bo.setFansNum(fansNum);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mv.addObject("starList", starList);
|
|
|
+ }
|
|
|
+ mv.setViewName("/portal/scienceTechnology/star");
|
|
|
return mv;
|
|
|
}
|
|
|
}
|