diff --git a/novel-front/src/main/java/com/java2nb/novel/FrontNovelApplication.java b/novel-front/src/main/java/com/java2nb/novel/FrontNovelApplication.java index f83b2d9..3ace218 100644 --- a/novel-front/src/main/java/com/java2nb/novel/FrontNovelApplication.java +++ b/novel-front/src/main/java/com/java2nb/novel/FrontNovelApplication.java @@ -5,6 +5,7 @@ import io.shardingsphere.shardingjdbc.spring.boot.SpringBootConfiguration; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; import org.springframework.cache.annotation.EnableCaching; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; @@ -20,6 +21,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; @EnableTransactionManagement @EnableScheduling @EnableCaching +@ServletComponentScan @MapperScan(basePackages = {"com.java2nb.novel.mapper"}) @Import(FdfsClientConfig.class) public class FrontNovelApplication { diff --git a/novel-front/src/main/java/com/java2nb/novel/core/config/WebsiteConfig.java b/novel-front/src/main/java/com/java2nb/novel/core/config/WebsiteConfig.java new file mode 100644 index 0000000..a5d2d6b --- /dev/null +++ b/novel-front/src/main/java/com/java2nb/novel/core/config/WebsiteConfig.java @@ -0,0 +1,20 @@ +package com.java2nb.novel.core.config; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +/** + * @author 11797 + */ +@Data +@Component +@ConfigurationProperties(prefix="website") +public class WebsiteConfig { + + private String name; + private String domain; + private String keyword; + private String description; + private String qq; +} diff --git a/novel-front/src/main/java/com/java2nb/novel/core/listener/StarterListener.java b/novel-front/src/main/java/com/java2nb/novel/core/listener/StarterListener.java new file mode 100644 index 0000000..8dbf825 --- /dev/null +++ b/novel-front/src/main/java/com/java2nb/novel/core/listener/StarterListener.java @@ -0,0 +1,28 @@ +package com.java2nb.novel.core.listener; + +import com.java2nb.novel.core.config.WebsiteConfig; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +/** + * 启动监听器 + * @author xiongxiaoyang + */ +@WebListener +@Slf4j +@RequiredArgsConstructor +public class StarterListener implements ServletContextListener { + + private final WebsiteConfig websiteConfig; + + + @Override + public void contextInitialized(ServletContextEvent sce) { + sce.getServletContext().setAttribute("website",websiteConfig); + + } +} diff --git a/novel-front/src/main/resources/application-website.yml b/novel-front/src/main/resources/application-website.yml new file mode 100644 index 0000000..4c2eaca --- /dev/null +++ b/novel-front/src/main/resources/application-website.yml @@ -0,0 +1,7 @@ +#网站配置 +website: + name: 小说精品屋 + domain: xiongxyang.gitee.io/home + keyword: ${application.website.name},小说,小说CMS,原创文学系统,开源小说系统,免费小说建站程序 + description: ${application.website.name}是一个多端(PC、WAP)阅读、功能完善的原创文学CMS系统,由前台门户系统、作家后台管理系统、平台后台管理系统、爬虫管理系统等多个子系统构成,支持会员充值、订阅模式、新闻发布和实时统计报表等功能,新书自动入库,老书自动更新。 + qq: 1179705413 diff --git a/novel-front/src/main/resources/application.yml b/novel-front/src/main/resources/application.yml index 77d188f..2b331cc 100644 --- a/novel-front/src/main/resources/application.yml +++ b/novel-front/src/main/resources/application.yml @@ -4,7 +4,7 @@ server: spring: profiles: active: dev - include: alipay,oss,fastdfs + include: website,alipay,oss,fastdfs rabbitmq: diff --git a/novel-front/src/main/resources/messages.properties b/novel-front/src/main/resources/messages.properties deleted file mode 100644 index 7a8a983..0000000 --- a/novel-front/src/main/resources/messages.properties +++ /dev/null @@ -1,5 +0,0 @@ -#网站配置 -#网站名 -website.name=小说精品屋 -#PC站网站域名 -website.domain=www.java2nb.com diff --git a/novel-front/src/main/resources/templates/about/contact.html b/novel-front/src/main/resources/templates/about/contact.html index 56e79e9..8850110 100644 --- a/novel-front/src/main/resources/templates/about/contact.html +++ b/novel-front/src/main/resources/templates/about/contact.html @@ -3,9 +3,9 @@ - + - + @@ -30,8 +30,8 @@

联系我们

- - + +

 

 

diff --git a/novel-front/src/main/resources/templates/about/copyright.html b/novel-front/src/main/resources/templates/about/copyright.html index eac94cb..74f97e6 100644 --- a/novel-front/src/main/resources/templates/about/copyright.html +++ b/novel-front/src/main/resources/templates/about/copyright.html @@ -3,9 +3,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/about/default.html b/novel-front/src/main/resources/templates/about/default.html index dfc9bd7..2241fe9 100644 --- a/novel-front/src/main/resources/templates/about/default.html +++ b/novel-front/src/main/resources/templates/about/default.html @@ -1,9 +1,9 @@ - + - + @@ -27,7 +27,7 @@

关于我们

-

+

diff --git a/novel-front/src/main/resources/templates/about/news.html b/novel-front/src/main/resources/templates/about/news.html index 350bb5a..a297d1d 100644 --- a/novel-front/src/main/resources/templates/about/news.html +++ b/novel-front/src/main/resources/templates/about/news.html @@ -2,10 +2,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - + + th:content="${application.website.name}+'小说每日更新小说连载,小说排行榜,提供言情小说,都市小说,玄幻小说,穿越小说,青春小说,总裁豪门小说,网络小说,免费小说,全本小说,首发小说,最新章节免费小说阅读,精彩尽在'+${application.website.name}+'小说!'"/> diff --git a/novel-front/src/main/resources/templates/about/news_info.html b/novel-front/src/main/resources/templates/about/news_info.html index bd501ed..7249ae6 100644 --- a/novel-front/src/main/resources/templates/about/news_info.html +++ b/novel-front/src/main/resources/templates/about/news_info.html @@ -1,9 +1,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/about/submission.html b/novel-front/src/main/resources/templates/about/submission.html index 902e4d6..cb50474 100644 --- a/novel-front/src/main/resources/templates/about/submission.html +++ b/novel-front/src/main/resources/templates/about/submission.html @@ -3,9 +3,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/about/user_agreement.html b/novel-front/src/main/resources/templates/about/user_agreement.html index f143767..b17a735 100644 --- a/novel-front/src/main/resources/templates/about/user_agreement.html +++ b/novel-front/src/main/resources/templates/about/user_agreement.html @@ -3,9 +3,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/book/book_comment.html b/novel-front/src/main/resources/templates/book/book_comment.html index 924b2f2..fa93712 100644 --- a/novel-front/src/main/resources/templates/book/book_comment.html +++ b/novel-front/src/main/resources/templates/book/book_comment.html @@ -3,9 +3,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/book/book_content.html b/novel-front/src/main/resources/templates/book/book_content.html index f0a3c18..b254f93 100644 --- a/novel-front/src/main/resources/templates/book/book_content.html +++ b/novel-front/src/main/resources/templates/book/book_content.html @@ -2,9 +2,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/book/book_detail.html b/novel-front/src/main/resources/templates/book/book_detail.html index c87d7f7..28a92ca 100644 --- a/novel-front/src/main/resources/templates/book/book_detail.html +++ b/novel-front/src/main/resources/templates/book/book_detail.html @@ -2,11 +2,11 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - + + th:content="${book.bookName}+','+${book.bookName}+'小说阅读,'+${book.bookName}+'由作家'+${book.authorName}+'创作,'+${application.website.name}+'提供'+${book.bookName}+'首发最新章节及txt下载,'+${book.bookName}+'最新更新章节,精彩尽在'+${application.website.name}+'。'"/> @@ -22,7 +22,7 @@
diff --git a/novel-front/src/main/resources/templates/book/book_index.html b/novel-front/src/main/resources/templates/book/book_index.html index bb80180..33c497f 100644 --- a/novel-front/src/main/resources/templates/book/book_index.html +++ b/novel-front/src/main/resources/templates/book/book_index.html @@ -2,10 +2,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - + + th:content="${application.website.name}+'小说为您提供'+${book.bookName}+'目录,'+${book.bookName}+'最新章节列表,'+${book.bookName}+'全文阅读,'+${book.bookName}+'免费阅读,'+${book.bookName}+'下载'"/> @@ -16,7 +16,7 @@
diff --git a/novel-front/src/main/resources/templates/book/book_ranking.html b/novel-front/src/main/resources/templates/book/book_ranking.html index 23e93be..50bb2fc 100644 --- a/novel-front/src/main/resources/templates/book/book_ranking.html +++ b/novel-front/src/main/resources/templates/book/book_ranking.html @@ -3,9 +3,9 @@ - + - + diff --git a/novel-front/src/main/resources/templates/book/bookclass.html b/novel-front/src/main/resources/templates/book/bookclass.html index 2c53f08..a44cea9 100644 --- a/novel-front/src/main/resources/templates/book/bookclass.html +++ b/novel-front/src/main/resources/templates/book/bookclass.html @@ -2,10 +2,10 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - - + + + th:content="${application.website.name}+'每日更新小说连载,小说排行榜,提供言情小说,都市小说,玄幻小说,穿越小说,青春小说,总裁豪门小说,网络小说,免费小说,全本小说,首发小说,最新章节免费小说阅读,精彩尽在'+${application.website.name}+'。'"/> diff --git a/novel-front/src/main/resources/templates/common/footer.html b/novel-front/src/main/resources/templates/common/footer.html index eb6d599..663d501 100644 --- a/novel-front/src/main/resources/templates/common/footer.html +++ b/novel-front/src/main/resources/templates/common/footer.html @@ -3,7 +3,7 @@ diff --git a/novel-front/src/main/resources/templates/common/top.html b/novel-front/src/main/resources/templates/common/top.html index a2738b4..80fc951 100644 --- a/novel-front/src/main/resources/templates/common/top.html +++ b/novel-front/src/main/resources/templates/common/top.html @@ -2,7 +2,7 @@