From 86422987022d7c0593b74f62728b7d95e2edb5e7 Mon Sep 17 00:00:00 2001 From: senghor <15207108156@163.com> Date: Tue, 18 Dec 2018 16:15:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=92=8Credis=E8=BF=9E=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .project | 17 +++++++++++++++++ .settings/org.eclipse.core.resources.prefs | 2 ++ .settings/org.eclipse.m2e.core.prefs | 4 ++++ .../src/main/resources/application-dev.yml | 12 ++++++------ .../src/main/resources/application-test.yml | 12 ++++++------ blog-admin/src/main/resources/application.yml | 6 +++--- blog-web/src/main/resources/application-dev.yml | 12 ++++++------ .../src/main/resources/application-test.yml | 12 ++++++------ blog-web/src/main/resources/application.yml | 6 +++--- 9 files changed, 53 insertions(+), 30 deletions(-) create mode 100644 .project create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 .settings/org.eclipse.m2e.core.prefs diff --git a/.project b/.project new file mode 100644 index 0000000..7e9a6c5 --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + blog + + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + + diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..99f26c0 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/blog-admin/src/main/resources/application-dev.yml b/blog-admin/src/main/resources/application-dev.yml index ce726f8..0a4f9d4 100644 --- a/blog-admin/src/main/resources/application-dev.yml +++ b/blog-admin/src/main/resources/application-dev.yml @@ -7,23 +7,23 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://www.senghor.cn:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true username: root - password: root + password: SGJsgj@.970811 # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 # 指定SMTP server使用的协议,默认为: smtp protocol: smtp # 指定SMTP server host. - host: xxx + host: smtp.qq.com port: 465 # 指定SMTP server的用户名. - username: xxx + username: 1374656719@qq.com # 指定SMTP server登陆密码: - password: xxx + password: vydbbhcysvnbghjj # 指定是否在启动时测试邮件服务器连接,默认为false - test-connection: false + test-connection: true properties: mail.smtp.auth: true # 腾讯企业邮箱 下两个配置必须!!! diff --git a/blog-admin/src/main/resources/application-test.yml b/blog-admin/src/main/resources/application-test.yml index d2e59f9..83b20e7 100644 --- a/blog-admin/src/main/resources/application-test.yml +++ b/blog-admin/src/main/resources/application-test.yml @@ -7,23 +7,23 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://www.senghor.cn:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true username: root - password: root + password: SGJsgj@.970811 # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 # 指定SMTP server使用的协议,默认为: smtp protocol: smtp # 指定SMTP server host. - host: xxx + host: smtp.qq.com port: 465 # 指定SMTP server的用户名. - username: xxx + username: 1374656719@qq.com # 指定SMTP server登陆密码: - password: xxx + password: vydbbhcysvnbghjj # 指定是否在启动时测试邮件服务器连接,默认为false - test-connection: false + test-connection: true properties: mail.smtp.auth: true # 腾讯企业邮箱 下两个配置必须!!! diff --git a/blog-admin/src/main/resources/application.yml b/blog-admin/src/main/resources/application.yml index ef2acfd..bad5ae2 100644 --- a/blog-admin/src/main/resources/application.yml +++ b/blog-admin/src/main/resources/application.yml @@ -65,11 +65,11 @@ spring: redis: database: 1 # Redis服务器地址 - host: 127.0.0.1 + host: 47.107.117.68 # Redis服务器连接端口 - port: 6379 + port: 6279 # Redis服务器连接密码(默认为空) - password: + password: sgj970811 jedis: pool: # 连接池最大连接数(使用负值表示没有限制) diff --git a/blog-web/src/main/resources/application-dev.yml b/blog-web/src/main/resources/application-dev.yml index eb6c3f9..f10b9b6 100644 --- a/blog-web/src/main/resources/application-dev.yml +++ b/blog-web/src/main/resources/application-dev.yml @@ -7,23 +7,23 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://www.senghor.cn:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true username: root - password: root + password: SGJsgj@.970811 # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 # 指定SMTP server使用的协议,默认为: smtp protocol: smtp # 指定SMTP server host. - host: xxx + host: smtp.qq.com port: 465 # 指定SMTP server的用户名. - username: xxx + username: 1374656719@qq.com # 指定SMTP server登陆密码: - password: xxx + password: vydbbhcysvnbghjj # 指定是否在启动时测试邮件服务器连接,默认为false - test-connection: false + test-connection: true properties: mail.smtp.auth: true # 腾讯企业邮箱 下两个配置必须!!! diff --git a/blog-web/src/main/resources/application-test.yml b/blog-web/src/main/resources/application-test.yml index a657b45..931d6c1 100644 --- a/blog-web/src/main/resources/application-test.yml +++ b/blog-web/src/main/resources/application-test.yml @@ -7,23 +7,23 @@ spring: datasource: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.jdbc.Driver - url: jdbc:mysql://localhost:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://www.senghor.cn:3306/dblog?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&allowPublicKeyRetrieval=true username: root - password: root + password: SGJsgj@.970811 # 指定默认MimeMessage的编码,默认为: UTF-8 mail: default-encoding: UTF-8 # 指定SMTP server使用的协议,默认为: smtp protocol: smtp # 指定SMTP server host. - host: xxx + host: smtp.qq.com port: 465 # 指定SMTP server的用户名. - username: xxx + username: 1374656719@qq.com # 指定SMTP server登陆密码: - password: xxx + password: vydbbhcysvnbghjj # 指定是否在启动时测试邮件服务器连接,默认为false - test-connection: false + test-connection: true properties: mail.smtp.auth: true # 腾讯企业邮箱 下两个配置必须!!! diff --git a/blog-web/src/main/resources/application.yml b/blog-web/src/main/resources/application.yml index 6044a38..b167d3c 100644 --- a/blog-web/src/main/resources/application.yml +++ b/blog-web/src/main/resources/application.yml @@ -65,11 +65,11 @@ spring: redis: database: 1 # Redis服务器地址 - host: 127.0.0.1 + host: 47.107.117.68 # Redis服务器连接端口 - port: 6379 + port: 6279 # Redis服务器连接密码(默认为空) - password: + password: sgj970811 jedis: pool: # 连接池最大连接数(使用负值表示没有限制) -- Gitee From 1334414b38bc680315ac413ce2176c42c7fa11d1 Mon Sep 17 00:00:00 2001 From: senghor <15207108156@163.com> Date: Thu, 20 Dec 2018 20:55:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9web=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E4=B8=BA80=EF=BC=8Cadmin=E5=92=8Cweb?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0live2d?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E5=A8=98=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/include/macros.ftl | 3 +++ .../src/main/resources/templates/index.ftl | 2 +- .../resources/templates/layout/footer.ftl | 20 ++++++++++++++++++- blog-web/src/main/resources/application.yml | 2 +- .../src/main/resources/templates/index.ftl | 2 +- .../resources/templates/layout/footer.ftl | 19 +++++++++++++++++- .../main/resources/templates/layout/quote.ftl | 5 ++++- .../resources/templates/testWebsocket.ftl | 2 +- 8 files changed, 48 insertions(+), 7 deletions(-) diff --git a/blog-admin/src/main/resources/templates/include/macros.ftl b/blog-admin/src/main/resources/templates/include/macros.ftl index 9cff3ee..ba0f631 100644 --- a/blog-admin/src/main/resources/templates/include/macros.ftl +++ b/blog-admin/src/main/resources/templates/include/macros.ftl @@ -21,6 +21,9 @@ + + + <#nested> diff --git a/blog-admin/src/main/resources/templates/index.ftl b/blog-admin/src/main/resources/templates/index.ftl index 7bf6cd9..3b469da 100644 --- a/blog-admin/src/main/resources/templates/index.ftl +++ b/blog-admin/src/main/resources/templates/index.ftl @@ -284,7 +284,7 @@ - \ No newline at end of file + + + +
+
+ +
+ + + + + + + +
+
+ + + diff --git a/blog-web/src/main/resources/application.yml b/blog-web/src/main/resources/application.yml index b167d3c..8d3a6cc 100644 --- a/blog-web/src/main/resources/application.yml +++ b/blog-web/src/main/resources/application.yml @@ -1,6 +1,6 @@ # Server settings server: - port: 8443 + port: 80 # HTTP请求和响应头的最大量,以字节为单位,默认值为4096字节,超过此长度的部分不予处理,一般8K。解决java.io.EOFException: null问题 max-http-header-size: 8192 use-forward-headers: true diff --git a/blog-web/src/main/resources/templates/index.ftl b/blog-web/src/main/resources/templates/index.ftl index c3ff8d1..6ff3dbe 100644 --- a/blog-web/src/main/resources/templates/index.ftl +++ b/blog-web/src/main/resources/templates/index.ftl @@ -81,7 +81,7 @@
-
+
${item.description?if_exists}
diff --git a/blog-web/src/main/resources/templates/layout/footer.ftl b/blog-web/src/main/resources/templates/layout/footer.ftl index 8658818..ef76428 100644 --- a/blog-web/src/main/resources/templates/layout/footer.ftl +++ b/blog-web/src/main/resources/templates/layout/footer.ftl @@ -209,4 +209,21 @@ - \ No newline at end of file + + +
+
+ +
+ + + + + + + +
+
+ + + \ No newline at end of file diff --git a/blog-web/src/main/resources/templates/layout/quote.ftl b/blog-web/src/main/resources/templates/layout/quote.ftl index fe5d294..a3397a5 100644 --- a/blog-web/src/main/resources/templates/layout/quote.ftl +++ b/blog-web/src/main/resources/templates/layout/quote.ftl @@ -6,4 +6,7 @@ - \ No newline at end of file + + + + \ No newline at end of file diff --git a/blog-web/src/main/resources/templates/testWebsocket.ftl b/blog-web/src/main/resources/templates/testWebsocket.ftl index 640672c..223f359 100644 --- a/blog-web/src/main/resources/templates/testWebsocket.ftl +++ b/blog-web/src/main/resources/templates/testWebsocket.ftl @@ -38,7 +38,7 @@ } $.websocket.open({ - host: "ws://localhost:8443/websocket", + host: "ws://localhost:80/websocket", reconnect: true, callback: setMessageInnerHTML }); -- Gitee From ee3c53848eb217468fbf6dd236e782361a5f4516 Mon Sep 17 00:00:00 2001 From: senghor <15207108156@163.com> Date: Wed, 26 Dec 2018 20:48:22 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E7=AB=99?= =?UTF-8?q?=E5=A4=87=E6=A1=88=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/annotation/BussinessLog.java | 2 +- .../framework/object/BaseConditionVO.java | 20 ++++++++++--------- .../zyd/blog/controller/RenderController.java | 1 - .../resources/templates/layout/footer.ftl | 2 +- .../test/java/com/zyd/blog/BaseJunitTest.java | 10 ++++++++++ docs/html/web/about.html | 2 +- docs/html/web/archives.html | 2 +- docs/html/web/detail.html | 2 +- docs/html/web/disclaimer.html | 2 +- docs/html/web/guestbook.html | 2 +- docs/html/web/index.html | 2 +- docs/html/web/links.html | 2 +- 12 files changed, 30 insertions(+), 19 deletions(-) diff --git a/blog-core/src/main/java/com/zyd/blog/business/annotation/BussinessLog.java b/blog-core/src/main/java/com/zyd/blog/business/annotation/BussinessLog.java index 216c7fd..40b7640 100644 --- a/blog-core/src/main/java/com/zyd/blog/business/annotation/BussinessLog.java +++ b/blog-core/src/main/java/com/zyd/blog/business/annotation/BussinessLog.java @@ -33,5 +33,5 @@ public @interface BussinessLog { * 是否将当前日志记录到数据库中 */ boolean save() default true; - + } diff --git a/blog-core/src/main/java/com/zyd/blog/framework/object/BaseConditionVO.java b/blog-core/src/main/java/com/zyd/blog/framework/object/BaseConditionVO.java index 8b3aea6..2b4f490 100644 --- a/blog-core/src/main/java/com/zyd/blog/framework/object/BaseConditionVO.java +++ b/blog-core/src/main/java/com/zyd/blog/framework/object/BaseConditionVO.java @@ -7,6 +7,8 @@ import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; /** + * 分页参数 + * * @author yadong.zhang (yadong.zhang0415(a)gmail.com) * @website https://www.zhyd.me * @version 1.0 @@ -16,17 +18,17 @@ import java.util.Date; @Data @EqualsAndHashCode(callSuper = false) public class BaseConditionVO { - public final static int DEFAULT_PAGE_SIZE = 10; - private int pageNumber = 1; - private int pageSize = 0; - private int pageStart = 0; - private String orderField; - private String orderDirection; - private String keywords; + public final static int DEFAULT_PAGE_SIZE = 10;// 默认每页数量 + private int pageNumber = 1;// 当前页 + private int pageSize = 0;// 每页数量 + private int pageStart = 0;// 开始页 + private String orderField;// 排序字段 + private String orderDirection;// 排序方式desc/asc + private String keywords;// 关键字 @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date startDate; + private Date startDate;// 开始时间 @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - private Date endDate; + private Date endDate;// 结束时间 public int getPageSize() { return pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE; diff --git a/blog-web/src/main/java/com/zyd/blog/controller/RenderController.java b/blog-web/src/main/java/com/zyd/blog/controller/RenderController.java index 08ff0d6..4432d74 100644 --- a/blog-web/src/main/java/com/zyd/blog/controller/RenderController.java +++ b/blog-web/src/main/java/com/zyd/blog/controller/RenderController.java @@ -75,7 +75,6 @@ public class RenderController { public ModelAndView home(ArticleConditionVO vo, Model model) { model.addAttribute("url", INDEX_URL); loadIndexPage(vo, model); - return ResultUtil.view(INDEX_URL); } diff --git a/blog-web/src/main/resources/templates/layout/footer.ftl b/blog-web/src/main/resources/templates/layout/footer.ftl index ef76428..734da34 100644 --- a/blog-web/src/main/resources/templates/layout/footer.ftl +++ b/blog-web/src/main/resources/templates/layout/footer.ftl @@ -166,7 +166,7 @@