diff --git a/.project b/.project new file mode 100644 index 0000000000000000000000000000000000000000..7e9a6c5fdd64ee98d1eb7e15471499b2ddc51cfc --- /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 0000000000000000000000000000000000000000..99f26c0203a7844de00dbfc56e6a35d8ed3c022c --- /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 0000000000000000000000000000000000000000..f897a7f1cb2389f85fe6381425d29f0a9866fb65 --- /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/pom.xml b/blog-admin/pom.xml index 2a518c186436f2c19611953df990a9b1fc753c71..b4362ba714a2e34b4f288a86a1b65b1eef863b9f 100644 --- a/blog-admin/pom.xml +++ b/blog-admin/pom.xml @@ -25,6 +25,12 @@ org.springframework.boot spring-boot-starter-websocket + + + cn.hutool + hutool-all + 4.1.17 + diff --git a/blog-admin/src/main/java/com/zyd/blog/controller/RestApiController.java b/blog-admin/src/main/java/com/zyd/blog/controller/RestApiController.java index bfab614437231d252e67523ce7049e74049ec83d..ca092117aeccd02d76d2c4021bee219d993b3074 100644 --- a/blog-admin/src/main/java/com/zyd/blog/controller/RestApiController.java +++ b/blog-admin/src/main/java/com/zyd/blog/controller/RestApiController.java @@ -1,5 +1,20 @@ package com.zyd.blog.controller; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import cn.hutool.http.HttpUtil; + import com.zyd.blog.business.annotation.BussinessLog; import com.zyd.blog.business.entity.Config; import com.zyd.blog.business.enums.QiniuUploadType; @@ -10,17 +25,6 @@ import com.zyd.blog.core.websocket.util.WebSocketUtil; import com.zyd.blog.framework.object.ResponseVO; import com.zyd.blog.util.FileUtil; import com.zyd.blog.util.ResultUtil; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import java.io.UnsupportedEncodingException; -import java.util.HashMap; -import java.util.Map; /** * 其他api性质的接口 @@ -90,4 +94,17 @@ public class RestApiController { WebSocketUtil.sendNotificationMsg(msg, websocketServer.getOnlineUsers()); return ResultUtil.success("消息发送成功", articleService.listMaterial()); } + + /** + * @Description: 获取AI对话信息 + * @author 宋高俊 + * @param message + * @return + * @date 2019年1月19日下午3:12:52 + */ + @GetMapping("/sendMessage") + public ResponseVO sendMessage(String message) { + String msgTest = HttpUtil.get("http://i.itpk.cn/api.php?question="+message+"&api_key=6fd4aa50df8e51fed928e9f0594761a0&api_secret=ne2m1mb3yy0z"); + return ResultUtil.success("获取成功", msgTest); + } } diff --git a/blog-admin/src/main/resources/application-dev.yml b/blog-admin/src/main/resources/application-dev.yml index ce726f8f026dbb235a68c1a00918444f94237360..0a4f9d4f336040c8c0b7d7a7ce672b795033a9b9 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 d2e59f92ad32097923e0150902a0cf594ce9dcc9..83b20e7e6cf74639f854e61ccdf9a92f988c45e6 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 ef2acfd4d76a0f199cf8df9defefe4037b16e0e7..bad5ae21f465eceaaa7d25aad8e411f6be0e0c69 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-admin/src/main/resources/static/assets/js/zyd.table.js b/blog-admin/src/main/resources/static/assets/js/zyd.table.js index ba1764c34b9dde9d8d665e3b47fb57d7f78ec084..2ac405b1857b0f33ff7d7fd9556f367f1c115a6f 100644 --- a/blog-admin/src/main/resources/static/assets/js/zyd.table.js +++ b/blog-admin/src/main/resources/static/assets/js/zyd.table.js @@ -66,7 +66,7 @@ // exportDataType: "basic", //basic', 'all', 'selected'. // clickToSelect: true, //是否启用点击选中行 // singleSelect: true, - height: 440, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 + height: 743, //行高,如果没有设置height属性,表格自动根据记录条数觉得表格高度 onEditableSave: function (field, row, oldValue, $el) { if (options.updateUrl) { $.ajax({ diff --git a/blog-admin/src/main/resources/templates/article/list.ftl b/blog-admin/src/main/resources/templates/article/list.ftl index 4415fce55e7ea0747af6025dc77ab1a032c6d7ec..5c887eb1d379bf7edba8963f7bef3a0f7291a6be 100644 --- a/blog-admin/src/main/resources/templates/article/list.ftl +++ b/blog-admin/src/main/resources/templates/article/list.ftl @@ -69,6 +69,7 @@ url: "/article/list", getInfoUrl: "/article/get/{id}", removeUrl: "/article/remove", + height: 620, columns: [ { checkbox: true diff --git a/blog-admin/src/main/resources/templates/include/macros.ftl b/blog-admin/src/main/resources/templates/include/macros.ftl index 9cff3eece1dd33e0cbf69de51e101ee8c7f71416..dec3df402f5b017416e62782456a7b33013d6ebd 100644 --- a/blog-admin/src/main/resources/templates/include/macros.ftl +++ b/blog-admin/src/main/resources/templates/include/macros.ftl @@ -21,6 +21,10 @@ + + + + <#nested> diff --git a/blog-admin/src/main/resources/templates/index.ftl b/blog-admin/src/main/resources/templates/index.ftl index 7bf6cd9ec6f2d793cf1eb078e1fcd7131229cf35..3b469dab6aced1cfb4c11e78f4e113ac733211b9 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-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 216c7fd5748af1894fac88125736fcc2ca0ee104..40b7640e1e807b3beb8c39c8f1cb6ecc51d32bdf 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 8b3aea6d98d53d6182f13fd2871b4c091831398f..2b4f4905ce2f20f6cdb4111da8e8b1d19eb82a77 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 08ff0d640160c593d3fb3df182781ecac5afb574..4432d7424f0c6a1588f15b6ecc078c8556e6b39d 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/application-dev.yml b/blog-web/src/main/resources/application-dev.yml index eb6c3f981e1647d6f9969a3ba8bf1f88aac7eb3a..f10b9b6fe05ff291fec44d74852cecd418c18ae3 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 a657b45e07c261a46a0207660d650e1ec7dc9398..931d6c17c2d073b55ce61842fc25ea1bae293cfe 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 6044a3831e187ab140aa6bb760a8158d9f6bb75a..8d3a6ccfca7fd8afc904dc3f6321f3551d8fe05c 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 @@ -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/templates/index.ftl b/blog-web/src/main/resources/templates/index.ftl index c3ff8d1445e0b153121c300c9329633fefc0a179..6ff3dbeb22769589ef41c94bcff0a87cb86eae5b 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 86588183ebc8ba81fd0433f57b4d6b116dbd6131..734da34b61cf96e5bca281d68e0cc398c98675ac 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 @@