Antiloveg 8 years ago
parent
commit
39a67e1c7f

+ 9 - 3
src/main/java/com/goafanti/common/mapper/LectureMapper.xml

@@ -178,7 +178,9 @@
 	  		l.lecture_time as lectureTime,
 	  		l.summary,
 	  		l.lecture_url as lectureUrl,
-	  		ui.username 
+	  		ui.username,
+	  		l.hot,
+	  		l.dynamic
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 
@@ -252,7 +254,9 @@
 	  		l.lecture_time as lectureTime,
 	  		l.summary,
 	  		l.lecture_url as lectureUrl,
-	  		ui.username 
+	  		ui.username,
+	  		l.hot,
+	  		l.dynamic
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 
@@ -268,7 +272,9 @@
 	  		l.lecture_time as lectureTime,
 	  		l.summary,
 	  		l.lecture_url as lectureUrl,
-	  		ui.username 
+	  		ui.username,
+	  		l.hot,
+	  		l.dynamic
 	  	from lecture l
 	  	left join  user_identity ui on ui.uid = l.uid
 	  	where 

+ 28 - 12
src/main/java/com/goafanti/portal/controller/PortalStarController.java

@@ -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;
 	}
 }