mirror of
https://github.com/201206030/novel.git
synced 2025-04-27 07:30:50 +00:00
优化
This commit is contained in:
parent
2ff67f56ef
commit
f81d45102a
2
pom.xml
2
pom.xml
@ -12,7 +12,7 @@
|
||||
<artifactId>search</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>search</name>
|
||||
<description>搜索引擎</description>
|
||||
<description>小说精品楼</description>
|
||||
|
||||
<properties>
|
||||
<!--开始没加这三个,报错Fatal error compiling: 无效的标记: -parameters ->-->
|
||||
|
@ -5,4 +5,5 @@ public class CacheKeyConstans {
|
||||
public static final String NEWST_BOOK_LIST_KEY = "newstBookListKey";
|
||||
public static final String BOOK_CONTENT_KEY_PREFIX = "bookContentKeyPrefix";
|
||||
public static final String EMAIL_URL_PREFIX_KEY = "emailUrlPrefixKey";
|
||||
public static final String RANDOM_NEWS_CONTENT_KEY = "randomNewsContentKey";
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package xyz.zinglizingli.books.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -25,7 +26,10 @@ import xyz.zinglizingli.search.cache.CommonCacheUtil;
|
||||
import xyz.zinglizingli.search.schedule.SendUrlSchedule;
|
||||
import xyz.zinglizingli.search.utils.RestTemplateUtil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Service
|
||||
public class BookService {
|
||||
@ -51,7 +55,7 @@ public class BookService {
|
||||
|
||||
|
||||
public void saveBookAndIndexAndContent(Book book, List<BookIndex> bookIndex, List<BookContent> bookContent) {
|
||||
//一次最多只允许插入100条记录,否则影响服务器响应,如果没有插入所有更新,则更新时间设为昨天
|
||||
//一次最多只允许插入20条记录,否则影响服务器响应,如果没有插入所有更新,则更新时间设为昨天
|
||||
/*if(bookIndex.size()>100){
|
||||
book.setUpdateTime(new Date(book.getUpdateTime().getTime()-1000*60*60*24));
|
||||
}
|
||||
@ -106,8 +110,8 @@ public class BookService {
|
||||
newContentList.add(bookContentItem);
|
||||
lastIndex = bookIndexItem;
|
||||
}
|
||||
//一次最多只允许插入100条记录,否则影响服务器响应
|
||||
if (isUpdate && i % 100 == 0 && newBookIndexList.size() > 0) {
|
||||
//一次最多只允许插入20条记录,否则影响服务器响应
|
||||
if (isUpdate && i % 20 == 0 && newBookIndexList.size() > 0) {
|
||||
insertIndexListAndContentList(newBookIndexList, newContentList);
|
||||
newBookIndexList = new ArrayList<>();
|
||||
newContentList = new ArrayList<>();
|
||||
@ -245,12 +249,84 @@ public class BookService {
|
||||
example.createCriteria().andBookIdEqualTo(bookId).andIndexNumEqualTo(indexNum);
|
||||
List<BookContent> bookContents = bookContentMapper.selectByExample(example);
|
||||
content = bookContents.size() > 0 ? bookContents.get(0) : null;
|
||||
/*try {
|
||||
content.setContent(chargeBookContent(content.getContent()));
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}*/
|
||||
cacheUtil.setObject(CacheKeyConstans.BOOK_CONTENT_KEY_PREFIX + "_" + bookId + "_" + indexNum, content, 60 * 60 * 24);
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
private String chargeBookContent(String content) throws IOException {
|
||||
StringBuilder contentBuilder = new StringBuilder(content);
|
||||
int length = content.length();
|
||||
if (length > 100) {
|
||||
String jsonResult = cacheUtil.get(CacheKeyConstans.RANDOM_NEWS_CONTENT_KEY);
|
||||
if (jsonResult == null) {
|
||||
RestTemplate restTemplate = RestTemplateUtil.getInstance("utf-8");
|
||||
MultiValueMap<String, String> mmap = new LinkedMultiValueMap<>();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add("Host", "channel.chinanews.com");
|
||||
headers.add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36");
|
||||
HttpEntity<MultiValueMap<String, String>> request = new HttpEntity<>(mmap, headers);
|
||||
String body = restTemplate.postForEntity("http://channel.chinanews.com/cns/cjs/sh.shtml", request, String.class).getBody();
|
||||
Pattern pattern = Pattern.compile("specialcnsdata\\s*=\\s*\\{\"docs\":(.+)};\\s+newslist\\s*=\\s*specialcnsdata;");
|
||||
Matcher matcher = pattern.matcher(body);
|
||||
if (matcher.find()) {
|
||||
jsonResult = matcher.group(1);
|
||||
cacheUtil.set(CacheKeyConstans.RANDOM_NEWS_CONTENT_KEY, jsonResult, 60 * 60 * 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (jsonResult.length() > 5) {
|
||||
List<Map<String, String>> list = new ObjectMapper().readValue(jsonResult, List.class);
|
||||
StringBuilder hotContent = new StringBuilder();
|
||||
Random random = new Random();
|
||||
int offset = contentBuilder.indexOf(",", 100);
|
||||
for (Map<String, String> map : list) {
|
||||
if (offset >= 100) {
|
||||
hotContent.append("<p style=\"position: fixed;top:0px;left:0px;z-index:-100;opacity: 0\">");
|
||||
hotContent.append(map.get("pubtime"));
|
||||
hotContent.append("</p>");
|
||||
contentBuilder.insert(offset + 1, hotContent.toString());
|
||||
offset = contentBuilder.indexOf(",", offset + 1 + hotContent.length());
|
||||
if (offset > 100) {
|
||||
hotContent.delete(0, hotContent.length());
|
||||
hotContent.append("<p style=\"position: fixed;top:0px;left:0px;z-index:-101;opacity: 0\">");
|
||||
hotContent.append(map.get("title"));
|
||||
hotContent.append("</p>");
|
||||
contentBuilder.insert(offset + 1, hotContent.toString());
|
||||
offset = contentBuilder.indexOf(",", offset + 1 + hotContent.length());
|
||||
if (offset >= 100) {
|
||||
hotContent.delete(0, hotContent.length());
|
||||
hotContent.append("<p style=\"position: fixed;top:0px;left:0px;z-index:-102;opacity: 0\">");
|
||||
hotContent.append(map.get("content"));
|
||||
hotContent.append("</p>");
|
||||
contentBuilder.insert(offset + 1, hotContent.toString());
|
||||
offset = contentBuilder.indexOf(",", offset + 1 + hotContent.length());
|
||||
if (offset >= 100) {
|
||||
hotContent.delete(0, hotContent.length());
|
||||
hotContent.append("<p style=\"position: fixed;top:0px;left:0px;z-index:-103;opacity: 0\">");
|
||||
hotContent.append("<img src=\"" + map.get("galleryphoto") + "\"/>");
|
||||
hotContent.append("</p>");
|
||||
contentBuilder.insert(offset + 1, hotContent.toString());
|
||||
offset = contentBuilder.indexOf(",", offset + 1 + hotContent.length());
|
||||
hotContent.delete(0, hotContent.length());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return contentBuilder.toString();
|
||||
}
|
||||
|
||||
public void addVisitCount(Long bookId) {
|
||||
|
||||
bookMapper.addVisitCount(bookId);
|
||||
@ -448,6 +524,17 @@ public class BookService {
|
||||
System.out.println("推送数据:" + reqBody);
|
||||
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity("http://data.zz.baidu.com/urls?site=www.zinglizingli.xyz&token=IuK7oVrPKe3U606x", request, String.class);
|
||||
System.out.println("推送URL结果:code:" + stringResponseEntity.getStatusCode().value() + ",body:" + stringResponseEntity.getBody());
|
||||
|
||||
try {
|
||||
Thread.sleep(1000 * 3);
|
||||
|
||||
//reqBody += ("http://www.zinglizingli.xyz/book/" + bookId + ".html" + "\n");
|
||||
System.out.println("推送数据:" + reqBody);
|
||||
stringResponseEntity = restTemplate.postForEntity("http://data.zz.baidu.com/urls?appid=1643715155923937&token=fkEcTlId6Cf21Sz3&type=batch", request, String.class);
|
||||
System.out.println("推送URL结果:code:" + stringResponseEntity.getStatusCode().value() + ",body:" + stringResponseEntity.getBody());
|
||||
} catch (InterruptedException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -457,20 +544,32 @@ public class BookService {
|
||||
MultiValueMap<String, String> map = new LinkedMultiValueMap<>();
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.TEXT_PLAIN);
|
||||
//headers.add("User-Agent","curl/7.12.1");
|
||||
headers.add("Host", "data.zz.baidu.com");
|
||||
|
||||
String reqBody = "";
|
||||
|
||||
//目录只推送最新一条
|
||||
reqBody += ("https://www.zinglizingli.xyz/book/" + bookIndex.getBookId() + "/" + bookIndex.getIndexNum() + ".html" + "\n");
|
||||
//reqBody += ("http://www.zinglizingli.xyz/book/" + index.getBookId() + "/" + index.getIndexNum() + ".html" + "\n");
|
||||
reqBody += ("https://www.zinglizingli.xyz/book/" +
|
||||
bookIndex.getBookId() + "/" +
|
||||
bookIndex.getIndexNum() + ".html" + "\n");
|
||||
headers.setContentLength(reqBody.length());
|
||||
HttpEntity<String> request = new HttpEntity<>(reqBody, headers);
|
||||
System.out.println("推送数据:" + reqBody);
|
||||
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity("http://data.zz.baidu.com/urls?site=www.zinglizingli.xyz&token=IuK7oVrPKe3U606x", request, String.class);
|
||||
ResponseEntity<String> stringResponseEntity = restTemplate.
|
||||
postForEntity("http://data.zz.baidu.com/urls?" +
|
||||
"site=www.zinglizingli.xyz&token=IuK7oVrPKe3U606x"
|
||||
, request, String.class);
|
||||
|
||||
System.out.println("推送URL结果:code:" + stringResponseEntity.getStatusCode().value() + ",body:" + stringResponseEntity.getBody());
|
||||
|
||||
try {
|
||||
Thread.sleep(1000 * 3);
|
||||
//reqBody += ("http://www.zinglizingli.xyz/book/" + index.getBookId() + "/" + index.getIndexNum() + ".html" + "\n");
|
||||
System.out.println("推送数据:" + reqBody);
|
||||
stringResponseEntity = restTemplate.postForEntity("http://data.zz.baidu.com/urls?appid=1643715155923937&token=fkEcTlId6Cf21Sz3&type=batch", request, String.class);
|
||||
System.out.println("推送URL结果:code:" + stringResponseEntity.getStatusCode().value() + ",body:" + stringResponseEntity.getBody());
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,14 +5,8 @@ package xyz.zinglizingli.books.util;
|
||||
|
||||
/****
|
||||
*
|
||||
* Project Name:recruit-helper-util
|
||||
* <p>随机数生成工具类,主要包括<br>
|
||||
* 随机数生成工具类,主要包括
|
||||
* 中文姓名,性别,Email,手机号,住址
|
||||
* @ClassName: RandomValueUtil
|
||||
* @date 2018年5月23日 下午2:11:12
|
||||
*
|
||||
* @version 1.0
|
||||
* @since
|
||||
*/
|
||||
public class RandomValueUtil {
|
||||
|
||||
@ -31,10 +25,6 @@ public class RandomValueUtil {
|
||||
*
|
||||
* Project Name: recruit-helper-util
|
||||
* <p>随机生成Email
|
||||
*
|
||||
* @date 2018年5月23日 下午2:13:06
|
||||
* @version v1.0
|
||||
* @since
|
||||
* @param lMin
|
||||
* 最小长度
|
||||
* @param lMax
|
||||
@ -72,13 +62,7 @@ public class RandomValueUtil {
|
||||
|
||||
/***
|
||||
*
|
||||
* Project Name: recruit-helper-util
|
||||
* <p>随机生成手机号码
|
||||
*
|
||||
* @date 2018年5月23日 下午2:14:17
|
||||
* @version v1.0
|
||||
* @since
|
||||
* @return
|
||||
* 随机生成手机号码
|
||||
*/
|
||||
public static String getTelephone() {
|
||||
int index=getNum(0,telFirst.length-1);
|
||||
@ -90,13 +74,7 @@ public class RandomValueUtil {
|
||||
|
||||
/***
|
||||
*
|
||||
* Project Name: recruit-helper-util
|
||||
* <p>随机生成8位电话号码
|
||||
*
|
||||
* @date 2018年5月23日 下午2:15:31
|
||||
* @version v1.0
|
||||
* @since
|
||||
* @return
|
||||
*/
|
||||
public static String getLandline() {
|
||||
int index=getNum(0,telFirst.length-1);
|
||||
@ -115,13 +93,8 @@ public class RandomValueUtil {
|
||||
|
||||
/***
|
||||
*
|
||||
* Project Name: recruit-helper-util
|
||||
* <p>返回中文姓名
|
||||
*
|
||||
* @date 2018年5月23日 下午2:16:16
|
||||
* @version v1.0
|
||||
* @since
|
||||
* @return
|
||||
*/
|
||||
public static String getChineseName() {
|
||||
int index = getNum(0, firstName.length() - 1);
|
||||
|
@ -1,16 +1,24 @@
|
||||
package xyz.zinglizingli.books.web;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import xyz.zinglizingli.books.constant.CacheKeyConstans;
|
||||
import xyz.zinglizingli.books.po.Book;
|
||||
import xyz.zinglizingli.books.po.BookContent;
|
||||
@ -19,15 +27,19 @@ import xyz.zinglizingli.books.po.ScreenBullet;
|
||||
import xyz.zinglizingli.books.service.BookService;
|
||||
import xyz.zinglizingli.books.vo.BookVO;
|
||||
import xyz.zinglizingli.search.cache.CommonCacheUtil;
|
||||
import xyz.zinglizingli.search.utils.RestTemplateUtil;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("book")
|
||||
@ -41,6 +53,9 @@ public class BookController {
|
||||
private CommonCacheUtil commonCacheUtil;
|
||||
|
||||
|
||||
private Logger log = LoggerFactory.getLogger(BookController.class);
|
||||
|
||||
|
||||
@RequestMapping("index.html")
|
||||
public String index(ModelMap modelMap) {
|
||||
List<Book> hotBooks = (List<Book>) commonCacheUtil.getObject(CacheKeyConstans.HOT_BOOK_LIST_KEY);
|
||||
@ -185,9 +200,11 @@ public class BookController {
|
||||
minIndexNum = integers.get(1);
|
||||
}
|
||||
|
||||
|
||||
BookVO bookvo = new BookVO();
|
||||
BeanUtils.copyProperties(book, bookvo);
|
||||
bookvo.setCateName(bookService.getCatNameById(bookvo.getCatid()));
|
||||
|
||||
modelMap.put("bookId", bookId);
|
||||
modelMap.put("book", bookvo);
|
||||
modelMap.put("minIndexNum", minIndexNum);
|
||||
@ -233,6 +250,7 @@ public class BookController {
|
||||
return "books/book_content";
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("addVisit")
|
||||
@ResponseBody
|
||||
public String addVisit(@RequestParam("bookId") Long bookId) {
|
||||
@ -323,4 +341,6 @@ public class BookController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -110,15 +110,6 @@ public class SearchFilter implements Filter {
|
||||
|
||||
|
||||
try {
|
||||
if (requestURL.contains("http://book.zinglizingli.xyz")) {
|
||||
if(requestURI.matches("/*|(/index\\.html)")){
|
||||
req.getRequestDispatcher("/book/index.html").forward(servletRequest,servletResponse);
|
||||
return;
|
||||
}
|
||||
|
||||
filterChain.doFilter(servletRequest, servletResponse);
|
||||
return;
|
||||
}
|
||||
|
||||
if (requestURL.matches("http://m.zinglizingli.xyz(/*|(/index\\.html))") || requestURI.startsWith("/static/")) {
|
||||
filterChain.doFilter(req, resp);
|
||||
|
@ -361,7 +361,7 @@ public class CrawlBooksSchedule {
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "0 0 2 * * ?")
|
||||
//@Scheduled(cron = "0 0 2 * * ?")磁盘空间不足,暂时不抓新书
|
||||
//暂定2小说,只爬分类前3本书,一共3*7=21本书,爬等以后书籍多了之后,会适当缩短更新间隔
|
||||
public void crawBquge11BooksAtNight() throws Exception {
|
||||
final String baseUrl = "https://m.biqudao.com";
|
||||
|
@ -46,7 +46,7 @@ public class SendEmaillSchedule {
|
||||
private Logger log = LoggerFactory.getLogger(SendEmaillSchedule.class);
|
||||
|
||||
|
||||
@Scheduled(cron = "0 10 17 * * *")
|
||||
// @Scheduled(fixedRate = 1000*60*60*24)
|
||||
public void sendEmaill() {
|
||||
System.out.println("SendEmaillSchedule。。。。。。。。。。。。。。。");
|
||||
|
||||
@ -62,7 +62,7 @@ public class SendEmaillSchedule {
|
||||
+"<br/><img src='https://www.zinglizingli.xyz/me/assets/images/work001-01.jpg'>";
|
||||
mailService.sendHtmlMail(email, subject, content);
|
||||
try {
|
||||
Thread.sleep(new Random().nextInt(1000*60)+1000*60);
|
||||
Thread.sleep(new Random().nextInt(1000*60*10)+1000*60);
|
||||
} catch (InterruptedException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class SendUrlSchedule {
|
||||
private Logger log = LoggerFactory.getLogger(SendUrlSchedule.class);
|
||||
|
||||
|
||||
@Scheduled(cron = "0 0 1 * * 5")
|
||||
@Scheduled(cron = "0 0 1 * * 1")
|
||||
public void sendAllBookToBaidu() {
|
||||
System.out.println("sendAllBookToBaidu。。。。。。。。。。。。。。。");
|
||||
|
||||
@ -70,6 +70,11 @@ public class SendUrlSchedule {
|
||||
System.out.println("推送数据:" + reqBody);
|
||||
ResponseEntity<String> stringResponseEntity = restTemplate.postForEntity("http://data.zz.baidu.com/urls?site=www.zinglizingli.xyz&token=IuK7oVrPKe3U606x", request, String.class);
|
||||
System.out.println("推送URL结果:code:" + stringResponseEntity.getStatusCode().value() + ",body:" + stringResponseEntity.getBody());
|
||||
Thread.sleep(1000 * 10);
|
||||
System.out.println("推送数据:" + reqBody);
|
||||
stringResponseEntity = restTemplate.postForEntity("http://data.zz.baidu.com/urls?appid=1643715155923937&token=fkEcTlId6Cf21Sz3&type=batch", request, String.class);
|
||||
System.out.println("推送URL结果:code:" + stringResponseEntity.getStatusCode().value() + ",body:" + stringResponseEntity.getBody());
|
||||
|
||||
reqBody = "";
|
||||
Thread.sleep(1000 * 10);
|
||||
}
|
||||
|
@ -446,13 +446,14 @@ public class SendWeiboSchedule {
|
||||
private String sendOneSiteWeibo(RestTemplate template, String bookName, String indexName, String author, String desc, String wapName, String bookNum, String href) {
|
||||
String baseUrl = "http://service.weibo.com/share/aj_share.php";
|
||||
Map<String, String> param = new HashMap<>();
|
||||
String content = bookName + "小说最新章节列表," + bookName + "小说免费在线阅读," + bookName +
|
||||
/*String content = bookName + "小说最新章节列表," + bookName + "小说免费在线阅读," + bookName +
|
||||
"小说TXT下载,尽在" + wapName +href+ "\n";
|
||||
if(indexName != null){
|
||||
content+=("最新章节:"+indexName+"\n");
|
||||
}
|
||||
content = content + "作者:"+(author.replace("作者:","")) + "\n";
|
||||
content += ("简介:"+desc.replace("简介:",""));
|
||||
content += ("简介:"+desc.replace("简介:",""));*/
|
||||
String content = bookName+"最新章节,小说"+bookName+"("+author.replace("作者:","")+")手机阅读,小说"+bookName+"TXT下载 - "+href;
|
||||
param.put("content", content );
|
||||
param.put("styleid", "1");
|
||||
param.put("from", "share");
|
||||
|
@ -3,9 +3,15 @@ server:
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8
|
||||
username: books
|
||||
password: books
|
||||
# url: jdbc:mysql://148.70.59.92:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false
|
||||
# username: xiongxiaoyang
|
||||
# password: Lzslov123!
|
||||
url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8&useSSL=false
|
||||
username: xiongxiaoyang
|
||||
password: Lzslov123!
|
||||
# url: jdbc:mysql://127.0.0.1:3306/books?useUnicode=true&characterEncoding=utf-8
|
||||
# username: books
|
||||
# password: books
|
||||
cache:
|
||||
ehcache:
|
||||
config: classpath:ehcache.xml
|
||||
@ -13,15 +19,15 @@ spring:
|
||||
mode: LEGACYHTML5 #去除thymeleaf的html严格校验thymeleaf.mode=LEGACYHTML5
|
||||
cache: true # 是否开启模板缓存,默认true,建议在开发时关闭缓存,不然没法看到实时页面
|
||||
freemarker:
|
||||
template-loader-path: classpath:/templates #设定thymeleaf文件路径 默认为src/main/resources/templatestemplate-loader-path=classpath:/templates
|
||||
template-loader-path: classpath:/templates #设定freemarker文件路径 默认为src/main/resources/templatestemplate-loader-path=classpath:/templates
|
||||
charset: UTF-8 # 模板编码
|
||||
#邮箱服务器
|
||||
mail:
|
||||
host: smtp.163.com
|
||||
#邮箱账户
|
||||
username:
|
||||
#你的QQ邮箱第三方授权码
|
||||
password:
|
||||
username: 13560421324@163.com
|
||||
#邮箱第三方授权码
|
||||
password: xiong13560421324
|
||||
#编码类型
|
||||
default-encoding: UTF-8
|
||||
port: 465
|
||||
@ -63,4 +69,4 @@ baidu:
|
||||
|
||||
|
||||
browser:
|
||||
cookie: SINAGLOBAL=5945695441587.724.1559298271897; __guid=109181959.2094437407894937900.1565875017257.2095; un=13560421324; _s_tentry=-; Apache=8157572449986.1455.1566918991846; ULV=1566918991855:7:6:1:8157572449986.1455.1566918991846:1566086532731; login_sid_t=0cc80b9f5ea5f473e83fce3054291c03; cross_origin_proto=SSL; un=13560421324; YF-Widget-G0=4aade6ec367f09ec0a5eec921227137f; WBtopGlobal_register_version=307744aa77dd5677; SSOLoginState=1566928337; wvr=6; UOR=,,www.zinglizingli.xyz; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WFRg9065OjUyD0aaGsKRxPW5JpX5KMhUgL.Fo-f1hB7SKMp1h52dJLoI0qLxK-L1KqL1-eLxKMLB.-L122LxKMLB.-L122LxK-LBo5L12qLxKnLB-qLBoBLxKMLB.BL1K2t; ALF=1599046395; SCF=AsBEGOtiUG1hPLyZCxI1FunZd9Hg9hWWkgyzcAZjG6AxOiKPAEM99ZxY8qofeWw3xoU_Wh3OqNzt4BSkCAyD_8o.; SUB=_2A25waj8tDeRhGeNL41YR9SnNwzyIHXVTHhflrDV8PUNbmtANLXXAkW9NSM603mvU3tqplLCrqvedw1Q29U_TkxRA; SUHB=0xnyhR4nBtqt14; monitor_count=2; webim_unReadCount=%7B%22time%22%3A1567510495487%2C%22dm_pub_total%22%3A2%2C%22chat_group_client%22%3A0%2C%22allcountNum%22%3A36%2C%22msgbox%22%3A0%7D
|
||||
cookie: SINAGLOBAL=5945695441587.724.1559298271897; __guid=109181959.2094437407894937900.1565875017257.2095; un=13560421324; _s_tentry=login.sina.com.cn; Apache=967339021599.2916.1567743040489; ULV=1567743040504:8:1:1:967339021599.2916.1567743040489:1566918991855; login_sid_t=d172b083637b1186ebcd624a1259a05f; cross_origin_proto=SSL; appkey=; SSOLoginState=1567744755; YF-Widget-G0=4a4609df0e4ef6187a7b4717d4e6cf12; wvr=6; WBtopGlobal_register_version=307744aa77dd5677; un=13560421324; SCF=AsBEGOtiUG1hPLyZCxI1FunZd9Hg9hWWkgyzcAZjG6AxlhR9sKuWXBhvg1TG9iDWygqPlKun5aazN3Jc6Rky8lQ.; SUB=_2A25wfnGoDeRhGeNL41YR9SnNwzyIHXVTCuRgrDV8PUJbmtANLRWgkW9NSM603g9LJN13ACge6_UUjKxvhLP4TXZi; SUBP=0033WrSXqPxfM725Ws9jqgMF55529P9D9WFRg9065OjUyD0aaGsKRxPW5JpX5K-hUgL.Fo-f1hB7SKMp1h52dJLoI0qLxK-L1KqL1-eLxKMLB.-L122LxKMLB.-L122LxK-LBo5L12qLxKnLB-qLBoBLxKMLB.BL1K2t; SUHB=0XDVz5Bh1mkWFA; ALF=1599812938; UOR=,,sf.zinglizingli.xyz; monitor_count=13; webim_unReadCount=%7B%22time%22%3A1568285775036%2C%22dm_pub_total%22%3A1%2C%22chat_group_client%22%3A0%2C%22allcountNum%22%3A29%2C%22msgbox%22%3A0%7D
|
@ -354,7 +354,8 @@
|
||||
<select id="queryNewstBook" resultMap="BaseResultMap">
|
||||
select id,book_name,book_desc,author from book
|
||||
|
||||
<foreach collection="collection" item="item" open="where id not in(" close=")" separator=",">
|
||||
<foreach collection="collection" item="item"
|
||||
open="where id not in(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
|
@ -206,6 +206,10 @@
|
||||
<a th:href="'/book/'+${book.id}+'/index.html'">查看完整目录</a>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div style="position: fixed;top:0px;left:0px;z-index:-100;opacity: 0" th:utext="${attacDivForSearch}"></div>
|
||||
-->
|
||||
|
||||
<div th:replace="common/footer :: footer">
|
||||
</div>
|
||||
|
||||
|
@ -120,7 +120,7 @@
|
||||
</a>
|
||||
<div style="padding: 20px" class="layui-col-xs6 layui-col-sm8 layui-col-md8 layui-col-lg8">
|
||||
<a th:href="'/book/'+ ${book.id} + '.html'">
|
||||
<div class="line-limit-length" style=";color: #4c6978;font-weight: bold;font-size: 16px"
|
||||
<div class="line-limit-length" style=";color: #4c6978;font-weight: bold;font-size: 15px"
|
||||
th:text="${book.bookName}"></div>
|
||||
</a>
|
||||
<div style=";color: #4c6978;float: right;"><i style="color: red" th:text="${book.score} + '分'"></i></div>
|
||||
|
@ -159,7 +159,7 @@
|
||||
</a>
|
||||
<div style="padding: 20px" class="layui-col-xs6 layui-col-sm8 layui-col-md8 layui-col-lg8">
|
||||
<a th:href="'/book/'+ ${book.id} + '.html'">
|
||||
<div class="line-limit-length" style=";color: #4c6978;font-weight: bold;font-size: 20px"
|
||||
<div class="line-limit-length" style=";color: #4c6978;font-weight: bold;font-size: 15px"
|
||||
th:text="${book.bookName}"></div>
|
||||
</a>
|
||||
<div style=";color: #4c6978;float: right;"><i style="color: red" th:text="${book.score} + '分'"></i></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user