pageNum = 1;
}
Topic topic = topicService.getTopicInfo(topicid);
List<Topic> subTopicList = topicService.getSubTopicList(topicid);
int totalNum = pushRecordService.getPushRecordNumByTopicAndType(topicid, type);
Page page = new Page(totalNum, pageNum);
if (pageSize != null) {
page.setPageSize(pageSize);
}
int totalPageNum = page.getTotalPage();
if (type == ViewMode.doc.ordinal()) {
List<PushRecord> pushRecordList = pushRecordService.getPushRecordByTopicid(topicid,
pageNum, page.getPageSize());
mav.addObject("pushRecordList", pushRecordList);
} else if (type == ViewMode.model.ordinal()) {
List<Model> modelList = modelService.getModelByTopic(topicid,
Model.modelType.normal.ordinal());
mav.addObject("modelList", modelList);
}
mav.addObject("subTopicList", subTopicList);
mav.addObject("totalPageNum", totalPageNum);
mav.addObject("pageNum", pageNum);
mav.addObject("nextPageNum", page.getNextPage());
mav.addObject("prePageNum", page.getPrePage());
mav.addObject("pageSize", page.getPageSize());
mav.addObject("type", type);
mav.addObject("topicid", topicid);
mav.addObject("topic", topic);
mav.setViewName(KeyConstant.ADMIN_JSP_PATH + "topicPage");
return mav;