diff --git a/tamguo-bms/src/main/java/com/tamguo/web/BookController.java b/tamguo-bms/src/main/java/com/tamguo/web/BookController.java index 3194219..daa6584 100644 --- a/tamguo-bms/src/main/java/com/tamguo/web/BookController.java +++ b/tamguo-bms/src/main/java/com/tamguo/web/BookController.java @@ -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 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)) { diff --git a/tamguo-bms/src/main/resources/application.properties b/tamguo-bms/src/main/resources/application.properties index e3e061d..42ce0b2 100644 --- a/tamguo-bms/src/main/resources/application.properties +++ b/tamguo-bms/src/main/resources/application.properties @@ -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 diff --git a/tamguo-bms/src/main/resources/templates/book/book.html b/tamguo-bms/src/main/resources/templates/book/book.html index 449de64..9bf982a 100644 --- a/tamguo-bms/src/main/resources/templates/book/book.html +++ b/tamguo-bms/src/main/resources/templates/book/book.html @@ -3,7 +3,7 @@ - 探果网 + 探书网 diff --git a/tamguo-bms/src/main/resources/templates/index.html b/tamguo-bms/src/main/resources/templates/index.html index 0f2bd4c..b54d70b 100644 --- a/tamguo-bms/src/main/resources/templates/index.html +++ b/tamguo-bms/src/main/resources/templates/index.html @@ -1,15 +1,15 @@ - 专业点的书籍代管平台_探书网 + 专业的高中书籍托管平台_探书网 - - + + diff --git a/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionService.java b/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionService.java index 93b97f6..5bead25 100644 --- a/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionService.java +++ b/tamguo-crawler/src/main/java/com/tamguo/service/impl/QuestionService.java @@ -53,8 +53,8 @@ public class QuestionService extends ServiceImpl @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; diff --git a/tamguo-crawler/src/main/java/com/tamguo/service/impl/SubjectService.java b/tamguo-crawler/src/main/java/com/tamguo/service/impl/SubjectService.java index 2c4bdfa..f964179 100644 --- a/tamguo-crawler/src/main/java/com/tamguo/service/impl/SubjectService.java +++ b/tamguo-crawler/src/main/java/com/tamguo/service/impl/SubjectService.java @@ -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()); diff --git a/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java b/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java index 3ceb6a8..b800e49 100644 --- a/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java +++ b/tamguo-crawler/src/test/java/com/tamguo/PaperCrawler.java @@ -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; diff --git a/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java b/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java index 9420454..c565a8e 100644 --- a/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java +++ b/tamguo-mms/src/main/java/com/tamguo/web/DocumentController.java @@ -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") diff --git a/tamguo-mms/src/main/java/com/tamguo/web/FileController.java b/tamguo-mms/src/main/java/com/tamguo/web/FileController.java index 11951c5..5452a76 100644 --- a/tamguo-mms/src/main/java/com/tamguo/web/FileController.java +++ b/tamguo-mms/src/main/java/com/tamguo/web/FileController.java @@ -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;