|
|
@@ -1,6 +1,6 @@
|
|
|
package com.goafanti.portal.controller;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -23,25 +23,36 @@ import com.goafanti.lecture.service.LectureService;
|
|
|
public class PortalLectureController extends BaseApiController {
|
|
|
@Resource
|
|
|
private LectureService lectureService;
|
|
|
-
|
|
|
- //@RequestMapping(value = "/portal/scienceTechnology/lecture", method = RequestMethod.GET)
|
|
|
- public ModelAndView lecture(){
|
|
|
+
|
|
|
+ // @RequestMapping(value = "/portal/scienceTechnology/lecture", method =
|
|
|
+ // RequestMethod.GET)
|
|
|
+ public ModelAndView lecture() {
|
|
|
ModelAndView mv = new ModelAndView();
|
|
|
List<LectureListBo> lectureList = lectureService.findLectureList();
|
|
|
+ if (null != lectureList && lectureList.size() > 0) {
|
|
|
+ Collections.reverse(lectureList);
|
|
|
+ }
|
|
|
mv.addObject("lectureList", lectureList);
|
|
|
mv.setViewName("/portal/scienceTechnology/lecture");
|
|
|
return mv;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 查看更多
|
|
|
*/
|
|
|
- @RequestMapping(value = "/portal/scienceTechnology/lecture/loadMore", method = RequestMethod.POST)
|
|
|
- public Result loadMore(String pageSize, String pageNo, String id){
|
|
|
+ @RequestMapping(value = "/portal/scienceTechnology/lecture/loadMore", method = RequestMethod.GET)
|
|
|
+ public Result loadMore(String pageSize, String pageNo) {
|
|
|
Result res = new Result();
|
|
|
- if (StringUtils.isNotBlank(id)){
|
|
|
- List<String> ids = Arrays.asList(id.trim().split(",|,"));
|
|
|
+ Integer pNo = 2;
|
|
|
+ Integer pSize = 5;
|
|
|
+ if (StringUtils.isNumeric(pageSize)) {
|
|
|
+ pSize = Integer.parseInt(pageSize);
|
|
|
}
|
|
|
+ if (StringUtils.isNumeric(pageNo)) {
|
|
|
+ pNo = Integer.parseInt(pageNo);
|
|
|
+ }
|
|
|
+ res.setData(lectureService.loadMore(pSize, pNo));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
}
|