main
tamguo 7 years ago
parent 4c3d8b5331
commit e3a9ae252a

@ -21,6 +21,8 @@ import com.tamguo.modules.book.model.DocumentEntity;
import com.tamguo.modules.book.model.enums.DocumentStatusEnum;
import com.tamguo.modules.book.service.IBookService;
import com.tamguo.modules.book.service.IDocumentService;
import com.tamguo.modules.member.model.MemberEntity;
import com.tamguo.modules.member.service.IMemberService;
@Controller
public class BookController {
@ -31,14 +33,19 @@ public class BookController {
private IBookService iBookService;
@Autowired
private IDocumentService iDocumentService;
@Autowired
private IMemberService iMemberService;
@SuppressWarnings("unchecked")
@RequestMapping(value="book/{id}.html" , method=RequestMethod.GET)
public ModelAndView book(@PathVariable String id , ModelAndView model) {
BookEntity book = iBookService.selectById(id);
MemberEntity member = iMemberService.selectById(book.getOwner());
if(member != null) {
book.setOwner(member.getUsername());
}
model.addObject("book", book);
model.setViewName("book/book");
// 查询第一章
List<DocumentEntity> documentList = iDocumentService.selectList(Condition.create().eq("book_id", id).eq("status", DocumentStatusEnum.NORMAL.getValue()).eq("parent_id", "0").orderAsc(Arrays.asList("create_date")));
if(!CollectionUtils.isEmpty(documentList)) {

@ -2,7 +2,7 @@ domain.name=https://book.tamguo.com/
admin.domain.name=https://admin.tamguo.com/
tamguo.domain.name=https://www.tamguo.com/
member.domain.name=http://member.tamguo.com/
cookie.domian.name=localhost
cookie.domian.name=tamguo.com
server.port=8083
jasypt.encryptor.password=tamguo

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title th:text="${book.name + ' - 探书网'}"></title>
<title th:text="${book.name + ' - 探书网'}"></title>
<meta name="site" content="https://book.tamguo.com" />
<meta name="keywords" th:content="${book.name + ',' + book.owner}">
<meta name="description" th:content="${book.name + ',' + book.owner}">

@ -1,15 +1,15 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<title>专业点的书籍代管平台_探书网</title>
<title>专业的高中书籍托管平台_探书网</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta name="author" content="tamguo" />
<meta name="site" content="https://book.tamguo.com" />
<meta name="keywords" content="书籍管理、章节管理、知识点管理、真题解析、专业文档">
<meta name="description" content="book.tamguo.com 是一个面向学生的书籍代管平台,提供书籍 、文章、博客、章节、知识点分享、打印、下载服务">
<meta name="keywords" content="书籍管理、章节管理、知识点管理、真题解析、试卷管理、专业文档">
<meta name="description" content="book.tamguo.com 是一个面向高中学生的书籍托管平台,提供书籍 、文章、博客、章节、试卷分析、试题分析、知识点分享、打印、下载服务">
<link th:href="${domainName + 'bootstrap/css/bootstrap.min.css'}" rel="stylesheet">
<link th:href="${domainName + 'font-awesome/css/font-awesome.min.css'}" rel="stylesheet">

@ -53,8 +53,8 @@ public class QuestionService extends ServiceImpl<QuestionMapper, QuestionEntity>
@Autowired
CacheService cacheService;
private static final String FILES_NO_FORMAT = "000000000";
private static final String FILES_PREFIX = "qyglzs";
private static final String COURSE_ID = "qiyeguanlizhishi";
private static final String FILES_PREFIX = "wulibxy";
private static final String COURSE_ID = "wuli";
private RunData runData;

@ -30,9 +30,9 @@ import com.xuxueli.crawler.rundata.RunData;
@Service
public class SubjectService implements ISubjectService{
private final static String COURSE_ID = "qiyeguanlizhishi";
private final static String BOOK_ID = "1025976567395184652";
private final static String SUBJECT_ID = "qiyefalvguwen";
private final static String COURSE_ID = "wuli";
private final static String BOOK_ID = "1060742388004642890";
private final static String SUBJECT_ID = "gaokao";
@Autowired
SubjectMapper subjectMapper;
@Autowired
@ -53,7 +53,7 @@ public class SubjectService implements ISubjectService{
@Override
public void crawlerSubject() {
XxlCrawler crawler = new XxlCrawler.Builder()
.setUrls("https://tiku.baidu.com/tikupc/chapterlist/ed6527d3240c844769eaee05-647-knowpoint-11")
.setUrls("https://tiku.baidu.com/tikupc/chapterlist/1bfd700abb68a98271fefa04-18-jiaocai-11")
.setAllowSpread(false)
.setFailRetryCount(5)
.setThreadCount(20)
@ -63,7 +63,7 @@ public class SubjectService implements ISubjectService{
public void parse(Document html, Element pageVoElement, SubjectVo subjectVo) {
// 解析封装 PageVo 对象
String pageUrl = html.baseUri();
if(pageUrl.contains("https://tiku.baidu.com/tikupc/chapterlist/ed6527d3240c844769eaee05-647-knowpoint-11")) {
if(pageUrl.contains("https://tiku.baidu.com/tikupc/chapterlist/1bfd700abb68a98271fefa04-18-jiaocai-11")) {
logger.info("开始解析书籍:{}" , pageUrl);
ChapterEntity chapterCondition = new ChapterEntity();
chapterCondition.setName(subjectVo.getChapterCurrName());

@ -34,13 +34,13 @@ public class PaperCrawler {
// 140000 山西 | 350000 福建 | 340000 安徽 | 220000 吉林 | 150000 内蒙古 | 640000 宁夏 | 650000 新疆 | 广西 450000 | 210000 辽宁
// 230000 黑龙江 | 610000 陕西 | 360000 江西 | 440000 广东 | 430000 湖南 | 460000 海南 | 530000 云南 | 510000 四川 | 630000 青海
// 620000 甘肃 | 130000 河北 | 540000 西藏 | 贵州 520000
private final String AREA_ID = "370000";
private final String AREA_ID = "350000";
// 年份
private final String YEAR = "2016";
// 真题试卷 类型(1:真题试卷,2:模拟试卷,3:押题预测,4:名校精品)
private final String PAPER_TYPE = "4";
private final String PAPER_TYPE = "2";
// 开始采集的URL
private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-20-7-2016-253-1-download";
private final String START_URL = "https://tiku.baidu.com/tikupc/paperlist/1bfd700abb68a98271fefa04-20-4-2016-799-1-download";
private RunData runData;

@ -50,7 +50,7 @@ public class DocumentController {
@Value("${file.storage.path}")
private String fileStoragePath;
@Value("${domain.name}")
@Value("${tamguo.domain.name}")
private String domainName;
@SuppressWarnings("unchecked")

@ -29,7 +29,7 @@ public class FileController {
@Value("${file.storage.path}")
private String fileStoragePath;
@Value("${domain.name}")
@Value("${tamguo.domain.name}")
private String domainName;
@Autowired
private IFileEntityService iFileEntityService;

Loading…
Cancel
Save