Antiloveg il y a 8 ans
Parent
commit
2918ca895e

+ 19 - 2
src/main/java/com/goafanti/portal/controller/PortalLectureController.java

@@ -15,8 +15,9 @@ import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.common.controller.BaseController;
 import com.goafanti.common.model.Banners;
+import com.goafanti.common.utils.StringUtils;
 import com.goafanti.lecture.bo.LectureListBo;
 import com.goafanti.lecture.service.LectureService;
 
@@ -24,7 +25,7 @@ import com.goafanti.lecture.service.LectureService;
  * 科技讲堂
  */
 @Controller
-public class PortalLectureController extends BaseApiController {
+public class PortalLectureController extends BaseController {
 	@Resource
 	private LectureService lectureService;
 	@Resource
@@ -62,5 +63,21 @@ public class PortalLectureController extends BaseApiController {
 			modelview.addObject("banners", banners);
 		}
 	}
+	
+	private Integer getPageNo(String pageNo){
+		if (StringUtils.isNumeric(pageNo)) {
+			Integer pn = Integer.parseInt(pageNo);
+			return pn < 1 ? 1 : pn;
+		}
+		return 1;
+	}
+	
+	private Integer getPageSize(String pageSize){
+		if (StringUtils.isNumeric(pageSize)) {
+			Integer ps = Integer.parseInt(pageSize);
+			return ps > 50 ? 50 : (ps < 10 ? 10 : ps);
+		}
+		return 10;
+	}
 
 }