删掉异常处理。

main
tamguo 7 years ago
parent b183266074
commit ef26f5a7da

@ -32,13 +32,14 @@ public class PaperCrawler {
private final String COURSE_ID = "likeshuxue";
// 110000 北京 | 310000 上海 | 500000 重庆 | 120100 天津 | 370000 山东 | 410000 河南 | 420000 湖北 | 320000 江苏 | 330000 浙江
// 140000 山西 | 350000 福建 | 340000 安徽 | 220000 吉林 | 150000 内蒙古 | 640000 宁夏 | 650000 新疆 | 广西 450000 | 210000 辽宁
private final String AREA_ID = "210000";
// 230000 黑龙江
private final String AREA_ID = "230000";
// 年份
private final String YEAR = "2015";
private final String YEAR = "2016";
// 真题试卷 类型(1:真题试卷,2:模拟试卷,3:押题预测,4:名校精品)
private final String PAPER_TYPE = "3";
private final String PAPER_TYPE = "4";
// 开始采集的URL
private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-16-2-2015-1180-1-download";
private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-16-7-2016-1247-1-download";
private RunData runData;

@ -61,7 +61,7 @@ public class PaperServiceImpl extends ServiceImpl<PaperMapper, PaperEntity> impl
List<PaperEntity> paperList = (List<PaperEntity>) cacheService.getObject(SystemConstant.HOT_PAPER);
if(paperList == null){
Page<PaperEntity> page = new Page<>(1 , 10);
paperList = paperMapper.selectPage(page, Condition.create().eq("area_id", areaId).orderDesc(Arrays.asList("id")));
paperList = paperMapper.selectPage(page, Condition.create().orderDesc(Arrays.asList("id")));
cacheService.setObject(SystemConstant.HOT_PAPER, paperList , 2 * 60 * 60);
}
return paperList;

@ -40,7 +40,6 @@ public class BookController {
@SuppressWarnings("unchecked")
@RequestMapping(value = {"book/{uid}.html"}, method = RequestMethod.GET)
public ModelAndView index(@PathVariable String uid , ModelAndView model , HttpServletRequest request) {
try {
// request url
logger.info("request url :{} " , request.getRequestURI());
BookEntity book = iBookService.selectById(uid);
@ -57,10 +56,6 @@ public class BookController {
model.addObject("bookList", bookList);
model.setViewName("book");
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
}

@ -46,7 +46,6 @@ public class CourseController {
@SuppressWarnings("unchecked")
@RequestMapping(value = {"course/{uid}.html"}, method = RequestMethod.GET)
public ModelAndView index(HttpServletRequest request , @PathVariable String uid , ModelAndView model) {
try {
// request url
logger.info("request url :{}" , request.getRequestURI());
CourseEntity course = iCourseService.selectById(uid);
@ -68,10 +67,6 @@ public class CourseController {
model.addObject("book" , book);
model.setViewName("chapter");
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"course/findChapter.html"}, method = RequestMethod.GET)

@ -54,7 +54,6 @@ public class PaperController {
@RequestMapping(value = {"paperlist/{subjectId}-{courseId}-{paperType}-{year}-{area}-{pageNum}.html"}, method = RequestMethod.GET)
public ModelAndView indexAction(HttpServletRequest request , @PathVariable String subjectId , @PathVariable String courseId , @PathVariable String paperType,
@PathVariable String year , @PathVariable String area , @PathVariable Integer pageNum, ModelAndView model) {
try {
// request url
logger.info("request url :{}" , request.getRequestURI());
CourseEntity course = iCourseService.selectById(courseId);
@ -102,11 +101,6 @@ public class PaperController {
model.setViewName("paperlist");
}
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@SuppressWarnings("unchecked")

@ -46,7 +46,6 @@ public class QuestionContrller {
@RequestMapping(value = {"questionlist/{chapterId}-{current}-{size}.html"}, method = RequestMethod.GET)
public ModelAndView questionList(@PathVariable String chapterId , @PathVariable Integer current ,
@PathVariable Integer size , ModelAndView model , HttpServletRequest request){
try {
// request url
logger.info("request url :{} " , request.getRequestURI());
model.setViewName("questionList");
@ -70,11 +69,6 @@ public class QuestionContrller {
model.addObject("subjectId", course.getSubjectId());
model.addObject("courseId", course.getId());
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
/**
@ -86,7 +80,6 @@ public class QuestionContrller {
@SuppressWarnings("unchecked")
@RequestMapping(value = {"/question/{uid}.html"}, method = RequestMethod.GET)
public ModelAndView question(@PathVariable String uid , ModelAndView model , HttpServletRequest request){
try {
// request url
logger.info("request url :{}" , request.getRequestURI());
model.setViewName("question");
@ -96,11 +89,6 @@ public class QuestionContrller {
model.addObject("course", iCourseService.selectById(question.getCourseId()));
model.addObject("answerList", iQuestionAnswerService.selectList(Condition.create().eq("question_id", uid).orderDesc(Arrays.asList("create_date"))));
return model;
} catch (Exception e) {
model.setViewName("404");
return model;
}
}
@RequestMapping(value = {"question/getQuestion/{uid}.html"}, method = RequestMethod.GET)

@ -54,7 +54,6 @@ public class SubjectController {
@SuppressWarnings("unchecked")
@RequestMapping(value = {"subject/{subjectId}.html"}, method = RequestMethod.GET)
public ModelAndView indexAction(@PathVariable String subjectId , HttpServletRequest request , ModelAndView model) {
try {
// request url
logger.info("request url :{} " , request.getRequestURI() );
SubjectEntity subject = iSubjectService.selectById(subjectId);
@ -78,14 +77,8 @@ public class SubjectController {
}else {
model.setViewName("subject");
}
return model;
} catch (Exception e) {
logger.error(e.getMessage() , e);
model.setViewName("500");
return model;
}
}
// [{"value":"11","label":"北京市","children":[{"value":"1101","label":"市辖区"}]}]
@RequestMapping(value = {"subject/getCourseCascaderTree.html"}, method = RequestMethod.GET)

Loading…
Cancel
Save