From 107d71a1df60580f3df92a3b8db474205da8196f Mon Sep 17 00:00:00 2001 From: tamguo Date: Tue, 14 Aug 2018 11:50:53 +0800 Subject: [PATCH] fix seo --- .../java/com/tamguo/ModifyQuestionImage.java | 7 ++++-- .../modules/tiku/model/CourseEntity.java | 22 +++++++++++++++++++ .../src/main/resources/templates/book.html | 6 ++--- .../src/main/resources/templates/chapter.html | 6 ++--- .../src/main/resources/templates/index.html | 1 + 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/tamguo-crawler/src/test/java/com/tamguo/ModifyQuestionImage.java b/tamguo-crawler/src/test/java/com/tamguo/ModifyQuestionImage.java index fadf7ec..badc300 100644 --- a/tamguo-crawler/src/test/java/com/tamguo/ModifyQuestionImage.java +++ b/tamguo-crawler/src/test/java/com/tamguo/ModifyQuestionImage.java @@ -29,13 +29,13 @@ public class ModifyQuestionImage { @SuppressWarnings("unchecked") @Test public void modify() { - Integer current = 1 ; + Integer current = 98 ; Integer size = 100; while(true) { Page page = new Page<>(current , size); Page entitys = iQuestionService.selectPage(page , Condition.create().orderAsc(Arrays.asList("id"))); - if(entitys.getPages() > 759) { + if(entitys.getCurrent() > 759) { break; } // 处理数据 @@ -43,6 +43,9 @@ public class ModifyQuestionImage { QuestionEntity question = entitys.getRecords().get(i); question.setAnalysis(question.getAnalysis().replaceAll("http://www.tamguo.com/", "")); question.setContent(question.getContent().replaceAll("http://www.tamguo.com/", "")); + if(question.getAnswer() == null) { + question.setAnswer(""); + } question.setAnswer(question.getAnswer().replaceAll("http://www.tamguo.com/", "")); } iQuestionService.updateAllColumnBatchById(entitys.getRecords()); diff --git a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/CourseEntity.java b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/CourseEntity.java index 65f9744..86790bf 100644 --- a/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/CourseEntity.java +++ b/tamguo-modules-core/src/main/java/com/tamguo/modules/tiku/model/CourseEntity.java @@ -21,6 +21,10 @@ public class CourseEntity { private Integer pointNum; private String remarks; + private String seoTitle; + private String seoKeywords; + private String seoDescription; + @TableField(fill = FieldFill.INSERT_UPDATE) private String createBy; @TableField(fill = FieldFill.INSERT_UPDATE) @@ -105,5 +109,23 @@ public class CourseEntity { public void setId(String id) { this.id = id; } + public String getSeoTitle() { + return seoTitle; + } + public void setSeoTitle(String seoTitle) { + this.seoTitle = seoTitle; + } + public String getSeoKeywords() { + return seoKeywords; + } + public void setSeoKeywords(String seoKeywords) { + this.seoKeywords = seoKeywords; + } + public String getSeoDescription() { + return seoDescription; + } + public void setSeoDescription(String seoDescription) { + this.seoDescription = seoDescription; + } } diff --git a/tamguo-tms/src/main/resources/templates/book.html b/tamguo-tms/src/main/resources/templates/book.html index 9edf8bf..99dac17 100644 --- a/tamguo-tms/src/main/resources/templates/book.html +++ b/tamguo-tms/src/main/resources/templates/book.html @@ -2,9 +2,9 @@ - - - + + + diff --git a/tamguo-tms/src/main/resources/templates/chapter.html b/tamguo-tms/src/main/resources/templates/chapter.html index 25292d7..24db781 100644 --- a/tamguo-tms/src/main/resources/templates/chapter.html +++ b/tamguo-tms/src/main/resources/templates/chapter.html @@ -2,9 +2,9 @@ - - - + + + diff --git a/tamguo-tms/src/main/resources/templates/index.html b/tamguo-tms/src/main/resources/templates/index.html index c13c88f..b1252d1 100644 --- a/tamguo-tms/src/main/resources/templates/index.html +++ b/tamguo-tms/src/main/resources/templates/index.html @@ -10,6 +10,7 @@ +