Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
智布道
OneBlog
提交
7f65b6ff
O
OneBlog
项目概览
智布道
/
OneBlog
9 个月 前同步成功
通知
11
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
OneBlog
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7f65b6ff
编写于
5月 25, 2018
作者:
Y
yadong.zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1. 修复后台标签等分页失败的问题
2. 修复前台自动申请友链失败的问题 3. 其他一些问题
上级
d646d560
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
429 addition
and
415 deletion
+429
-415
README.md
README.md
+9
-0
blog-admin/src/main/java/com/zyd/blog/controller/RestArticleController.java
...n/java/com/zyd/blog/controller/RestArticleController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestCommentController.java
...n/java/com/zyd/blog/controller/RestCommentController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestLinkController.java
...main/java/com/zyd/blog/controller/RestLinkController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestNoticeController.java
...in/java/com/zyd/blog/controller/RestNoticeController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestResourcesController.java
...java/com/zyd/blog/controller/RestResourcesController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestRoleController.java
...main/java/com/zyd/blog/controller/RestRoleController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestTagController.java
.../main/java/com/zyd/blog/controller/RestTagController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestTemplateController.java
.../java/com/zyd/blog/controller/RestTemplateController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestTypeController.java
...main/java/com/zyd/blog/controller/RestTypeController.java
+0
-1
blog-admin/src/main/java/com/zyd/blog/controller/RestUpdateController.java
...in/java/com/zyd/blog/controller/RestUpdateController.java
+0
-2
blog-admin/src/main/java/com/zyd/blog/controller/RestUserController.java
...main/java/com/zyd/blog/controller/RestUserController.java
+0
-2
blog-core/src/main/java/com/zyd/blog/business/aspect/RedisCacheAspect.java
...n/java/com/zyd/blog/business/aspect/RedisCacheAspect.java
+13
-32
blog-core/src/main/java/com/zyd/blog/business/service/impl/BizCommentServiceImpl.java
...zyd/blog/business/service/impl/BizCommentServiceImpl.java
+0
-1
blog-core/src/main/java/com/zyd/blog/business/service/impl/BizTagsServiceImpl.java
...om/zyd/blog/business/service/impl/BizTagsServiceImpl.java
+0
-1
blog-core/src/main/java/com/zyd/blog/business/service/impl/SysLinkServiceImpl.java
...om/zyd/blog/business/service/impl/SysLinkServiceImpl.java
+0
-6
blog-core/src/main/java/com/zyd/blog/util/CacheKeyUtil.java
blog-core/src/main/java/com/zyd/blog/util/CacheKeyUtil.java
+43
-0
blog-core/src/main/java/com/zyd/blog/util/RestClientUtil.java
...-core/src/main/java/com/zyd/blog/util/RestClientUtil.java
+1
-1
blog-core/src/main/resources/mybatis/SysLinkMapper.xml
blog-core/src/main/resources/mybatis/SysLinkMapper.xml
+3
-1
blog-web/src/main/resources/static/js/zhyd.comment.js
blog-web/src/main/resources/static/js/zhyd.comment.js
+360
-352
未找到文件。
README.md
浏览文件 @
7f65b6ff
...
@@ -90,6 +90,15 @@ _评论审核管理员_: 账号:comment-admin 密码:123456
...
@@ -90,6 +90,15 @@ _评论审核管理员_: 账号:comment-admin 密码:123456
### 更新日志
### 更新日志
2018-05-25
**修改功能:**
1.
修复后台标签等分页失败的问题
2.
修复前台自动申请友链失败的问题
3.
其他一些问题
2018-05-22
2018-05-22
**修改功能:**
**修改功能:**
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestArticleController.java
浏览文件 @
7f65b6ff
...
@@ -20,7 +20,6 @@
...
@@ -20,7 +20,6 @@
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Article
;
import
com.zyd.blog.business.entity.Article
;
import
com.zyd.blog.business.entity.Config
;
import
com.zyd.blog.business.entity.Config
;
...
@@ -64,7 +63,6 @@ public class RestArticleController {
...
@@ -64,7 +63,6 @@ public class RestArticleController {
@RequiresPermissions
(
"articles"
)
@RequiresPermissions
(
"articles"
)
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
ArticleConditionVO
vo
)
{
public
PageResult
list
(
ArticleConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Article
>
pageInfo
=
articleService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Article
>
pageInfo
=
articleService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestCommentController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Comment
;
import
com.zyd.blog.business.entity.Comment
;
import
com.zyd.blog.business.entity.Config
;
import
com.zyd.blog.business.entity.Config
;
...
@@ -65,7 +64,6 @@ public class RestCommentController {
...
@@ -65,7 +64,6 @@ public class RestCommentController {
@RequiresPermissions
(
"comments"
)
@RequiresPermissions
(
"comments"
)
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
CommentConditionVO
vo
)
{
public
PageResult
list
(
CommentConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Comment
>
pageInfo
=
commentService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Comment
>
pageInfo
=
commentService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestLinkController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Link
;
import
com.zyd.blog.business.entity.Link
;
import
com.zyd.blog.business.enums.LinkSourceEnum
;
import
com.zyd.blog.business.enums.LinkSourceEnum
;
...
@@ -56,7 +55,6 @@ public class RestLinkController {
...
@@ -56,7 +55,6 @@ public class RestLinkController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
LinkConditionVO
vo
)
{
public
PageResult
list
(
LinkConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Link
>
pageInfo
=
linkService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Link
>
pageInfo
=
linkService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestNoticeController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Notice
;
import
com.zyd.blog.business.entity.Notice
;
import
com.zyd.blog.business.entity.User
;
import
com.zyd.blog.business.entity.User
;
...
@@ -54,7 +53,6 @@ public class RestNoticeController {
...
@@ -54,7 +53,6 @@ public class RestNoticeController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
NoticeConditionVO
vo
)
{
public
PageResult
list
(
NoticeConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Notice
>
pageInfo
=
noticeService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Notice
>
pageInfo
=
noticeService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestResourcesController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Resources
;
import
com.zyd.blog.business.entity.Resources
;
import
com.zyd.blog.business.enums.ResponseStatus
;
import
com.zyd.blog.business.enums.ResponseStatus
;
...
@@ -57,7 +56,6 @@ public class RestResourcesController {
...
@@ -57,7 +56,6 @@ public class RestResourcesController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
getAll
(
ResourceConditionVO
vo
)
{
public
PageResult
getAll
(
ResourceConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Resources
>
pageInfo
=
resourcesService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Resources
>
pageInfo
=
resourcesService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestRoleController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Role
;
import
com.zyd.blog.business.entity.Role
;
import
com.zyd.blog.business.enums.ResponseStatus
;
import
com.zyd.blog.business.enums.ResponseStatus
;
...
@@ -60,7 +59,6 @@ public class RestRoleController {
...
@@ -60,7 +59,6 @@ public class RestRoleController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
getAll
(
RoleConditionVO
vo
)
{
public
PageResult
getAll
(
RoleConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Role
>
pageInfo
=
roleService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Role
>
pageInfo
=
roleService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestTagController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Tags
;
import
com.zyd.blog.business.entity.Tags
;
import
com.zyd.blog.business.enums.ResponseStatus
;
import
com.zyd.blog.business.enums.ResponseStatus
;
...
@@ -51,7 +50,6 @@ public class RestTagController {
...
@@ -51,7 +50,6 @@ public class RestTagController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
TagsConditionVO
vo
)
{
public
PageResult
list
(
TagsConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Tags
>
pageInfo
=
tagsService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Tags
>
pageInfo
=
tagsService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestTemplateController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.Template
;
import
com.zyd.blog.business.entity.Template
;
import
com.zyd.blog.business.enums.ResponseStatus
;
import
com.zyd.blog.business.enums.ResponseStatus
;
...
@@ -51,7 +50,6 @@ public class RestTemplateController {
...
@@ -51,7 +50,6 @@ public class RestTemplateController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
TemplateConditionVO
vo
)
{
public
PageResult
list
(
TemplateConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Template
>
pageInfo
=
templateService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Template
>
pageInfo
=
templateService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestTypeController.java
浏览文件 @
7f65b6ff
...
@@ -51,7 +51,6 @@ public class RestTypeController {
...
@@ -51,7 +51,6 @@ public class RestTypeController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
TypeConditionVO
vo
)
{
public
PageResult
list
(
TypeConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
Type
>
pageInfo
=
typeService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
Type
>
pageInfo
=
typeService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestUpdateController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.UpdateRecorde
;
import
com.zyd.blog.business.entity.UpdateRecorde
;
import
com.zyd.blog.business.enums.ResponseStatus
;
import
com.zyd.blog.business.enums.ResponseStatus
;
...
@@ -51,7 +50,6 @@ public class RestUpdateController {
...
@@ -51,7 +50,6 @@ public class RestUpdateController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
UpdateRecordeConditionVO
vo
)
{
public
PageResult
list
(
UpdateRecordeConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
UpdateRecorde
>
pageInfo
=
updateRecordeService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
UpdateRecorde
>
pageInfo
=
updateRecordeService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-admin/src/main/java/com/zyd/blog/controller/RestUserController.java
浏览文件 @
7f65b6ff
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
*/
*/
package
com.zyd.blog.controller
;
package
com.zyd.blog.controller
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.zyd.blog.business.entity.User
;
import
com.zyd.blog.business.entity.User
;
import
com.zyd.blog.business.enums.ResponseStatus
;
import
com.zyd.blog.business.enums.ResponseStatus
;
...
@@ -56,7 +55,6 @@ public class RestUserController {
...
@@ -56,7 +55,6 @@ public class RestUserController {
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
public
PageResult
list
(
UserConditionVO
vo
)
{
public
PageResult
list
(
UserConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
()
-
1
,
vo
.
getPageSize
());
PageInfo
<
User
>
pageInfo
=
userService
.
findPageBreakByCondition
(
vo
);
PageInfo
<
User
>
pageInfo
=
userService
.
findPageBreakByCondition
(
vo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
return
ResultUtil
.
tablePage
(
pageInfo
);
}
}
...
...
blog-core/src/main/java/com/zyd/blog/business/aspect/RedisCacheAspect.java
浏览文件 @
7f65b6ff
...
@@ -21,6 +21,7 @@ package com.zyd.blog.business.aspect;
...
@@ -21,6 +21,7 @@ package com.zyd.blog.business.aspect;
import
com.zyd.blog.business.annotation.RedisCache
;
import
com.zyd.blog.business.annotation.RedisCache
;
import
com.zyd.blog.framework.property.AppProperties
;
import
com.zyd.blog.framework.property.AppProperties
;
import
com.zyd.blog.util.CacheKeyUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.ProceedingJoinPoint
;
import
org.aspectj.lang.Signature
;
import
org.aspectj.lang.Signature
;
...
@@ -31,12 +32,9 @@ import org.aspectj.lang.reflect.MethodSignature;
...
@@ -31,12 +32,9 @@ import org.aspectj.lang.reflect.MethodSignature;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* Redis业务层数据缓存
* Redis业务层数据缓存
...
@@ -75,41 +73,24 @@ public class RedisCacheAspect {
...
@@ -75,41 +73,24 @@ public class RedisCacheAspect {
if
(!
currentMethod
.
isAnnotationPresent
(
RedisCache
.
class
))
{
if
(!
currentMethod
.
isAnnotationPresent
(
RedisCache
.
class
))
{
throw
new
RuntimeException
(
"未指定RedisChache注解!"
);
throw
new
RuntimeException
(
"未指定RedisChache注解!"
);
}
}
// 获取拦截方法的参数
StringBuilder
key
=
new
StringBuilder
(
point
.
getTarget
().
getClass
().
getName
());
String
className
=
point
.
getTarget
().
getClass
().
getName
();
String
methodName
=
currentMethod
.
getName
();
// 获取操作名称
// 获取操作名称
RedisCache
cache
=
currentMethod
.
getAnnotation
(
RedisCache
.
class
);
RedisCache
cache
=
currentMethod
.
getAnnotation
(
RedisCache
.
class
);
boolean
flush
=
cache
.
flush
();
if
(
cache
.
flush
())
{
StringBuilder
key
=
new
StringBuilder
();
log
.
info
(
"{}*-清空缓存"
,
key
);
//类名 + 方法名
Set
<
String
>
keys
=
redisTemplate
.
keys
(
key
.
toString
()
+
"*"
);
key
.
append
(
className
).
append
(
"."
).
append
(
methodName
);
redisTemplate
.
delete
(
keys
);
if
(
flush
)
{
log
.
info
(
"{}-清空缓存"
,
key
.
toString
());
Set
<
String
>
keys
=
redisTemplate
.
keys
(
className
+
"*"
);
if
(!
CollectionUtils
.
isEmpty
(
keys
))
{
redisTemplate
.
delete
(
keys
);
}
log
.
info
(
"Clear all the cached query result from redis"
);
log
.
info
(
"Clear all the cached query result from redis"
);
return
point
.
proceed
();
return
point
.
proceed
();
}
}
long
expire
=
cache
.
expire
();
key
.
append
(
"."
).
append
(
currentMethod
.
getName
());
TimeUnit
unit
=
cache
.
unit
();
key
.
append
(
CacheKeyUtil
.
getMethodParamsKey
(
point
.
getArgs
())).
append
(
cache
.
key
());
Object
[]
params
=
point
.
getArgs
();
String
realKey
=
key
.
toString
();
if
(
StringUtils
.
isEmpty
(
cache
.
key
()))
{
if
(
null
!=
params
&&
params
.
length
>
0
)
{
for
(
Object
obj
:
params
)
{
key
.
append
(
obj
.
toString
());
}
}
}
else
{
key
.
append
(
cache
.
key
());
}
// 缓存存在
// 缓存存在
boolean
hasKey
=
redisTemplate
.
hasKey
(
key
.
toString
()
);
boolean
hasKey
=
redisTemplate
.
hasKey
(
realKey
);
if
(
hasKey
)
{
if
(
hasKey
)
{
try
{
try
{
log
.
info
(
"{}从缓存中获取数据"
,
key
.
toString
()
);
log
.
info
(
"{}从缓存中获取数据"
,
realKey
);
return
redisTemplate
.
opsForValue
().
get
(
key
);
return
redisTemplate
.
opsForValue
().
get
(
key
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"从缓存中获取数据失败!"
,
e
);
log
.
error
(
"从缓存中获取数据失败!"
,
e
);
...
@@ -118,9 +99,9 @@ public class RedisCacheAspect {
...
@@ -118,9 +99,9 @@ public class RedisCacheAspect {
// 先执行业务
// 先执行业务
Object
result
=
point
.
proceed
();
Object
result
=
point
.
proceed
();
// 向Redis中添加数据,有效时间是30天
// 向Redis中添加数据,有效时间是30天
redisTemplate
.
opsForValue
().
set
(
key
.
toString
(),
result
,
expire
,
unit
);
redisTemplate
.
opsForValue
().
set
(
realKey
,
result
,
cache
.
expire
(),
cache
.
unit
()
);
log
.
info
(
"Put query result to redis"
);
log
.
info
(
"Put query result to redis"
);
log
.
info
(
"{}从数据库中获取数据"
,
key
.
toString
()
);
log
.
info
(
"{}从数据库中获取数据"
,
realKey
);
return
result
;
return
result
;
}
}
}
}
blog-core/src/main/java/com/zyd/blog/business/service/impl/BizCommentServiceImpl.java
浏览文件 @
7f65b6ff
...
@@ -87,7 +87,6 @@ public class BizCommentServiceImpl implements BizCommentService {
...
@@ -87,7 +87,6 @@ public class BizCommentServiceImpl implements BizCommentService {
* @return
* @return
*/
*/
@Override
@Override
// @RedisCache
public
PageInfo
<
Comment
>
findPageBreakByCondition
(
CommentConditionVO
vo
)
{
public
PageInfo
<
Comment
>
findPageBreakByCondition
(
CommentConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
List
<
BizComment
>
list
=
bizCommentMapper
.
findPageBreakByCondition
(
vo
);
List
<
BizComment
>
list
=
bizCommentMapper
.
findPageBreakByCondition
(
vo
);
...
...
blog-core/src/main/java/com/zyd/blog/business/service/impl/BizTagsServiceImpl.java
浏览文件 @
7f65b6ff
...
@@ -59,7 +59,6 @@ public class BizTagsServiceImpl implements BizTagsService{
...
@@ -59,7 +59,6 @@ public class BizTagsServiceImpl implements BizTagsService{
* @return
* @return
*/
*/
@Override
@Override
@RedisCache
public
PageInfo
<
Tags
>
findPageBreakByCondition
(
TagsConditionVO
vo
){
public
PageInfo
<
Tags
>
findPageBreakByCondition
(
TagsConditionVO
vo
){
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
List
<
BizTags
>
list
=
bizTagsMapper
.
findPageBreakByCondition
(
vo
);
List
<
BizTags
>
list
=
bizTagsMapper
.
findPageBreakByCondition
(
vo
);
...
...
blog-core/src/main/java/com/zyd/blog/business/service/impl/SysLinkServiceImpl.java
浏览文件 @
7f65b6ff
...
@@ -72,7 +72,6 @@ public class SysLinkServiceImpl implements SysLinkService {
...
@@ -72,7 +72,6 @@ public class SysLinkServiceImpl implements SysLinkService {
* @return
* @return
*/
*/
@Override
@Override
@RedisCache
public
PageInfo
<
Link
>
findPageBreakByCondition
(
LinkConditionVO
vo
)
{
public
PageInfo
<
Link
>
findPageBreakByCondition
(
LinkConditionVO
vo
)
{
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
PageHelper
.
startPage
(
vo
.
getPageNumber
(),
vo
.
getPageSize
());
List
<
SysLink
>
list
=
sysLinkMapper
.
findPageBreakByCondition
(
vo
);
List
<
SysLink
>
list
=
sysLinkMapper
.
findPageBreakByCondition
(
vo
);
...
@@ -172,11 +171,6 @@ public class SysLinkServiceImpl implements SysLinkService {
...
@@ -172,11 +171,6 @@ public class SysLinkServiceImpl implements SysLinkService {
throw
new
ZhydLinkException
(
"贵站暂未添加本站友情链接!请先添加本站友链后重新提交申请!"
);
throw
new
ZhydLinkException
(
"贵站暂未添加本站友情链接!请先添加本站友链后重新提交申请!"
);
}
}
// if (LinksUtil.checkFavicon(link.getFavicon())) {
// bo.setFavicon(link.getFavicon());
// } else {
// bo.setFavicon(link.getFavicon());
// }
link
.
setSource
(
LinkSourceEnum
.
AUTOMATIC
);
link
.
setSource
(
LinkSourceEnum
.
AUTOMATIC
);
link
.
setStatus
(
true
);
link
.
setStatus
(
true
);
if
(!
StringUtils
.
isEmpty
(
link
.
getEmail
())){
if
(!
StringUtils
.
isEmpty
(
link
.
getEmail
())){
...
...
blog-core/src/main/java/com/zyd/blog/util/CacheKeyUtil.java
0 → 100644
浏览文件 @
7f65b6ff
/**
* MIT License
* Copyright (c) 2018 yadong.zhang
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package
com.zyd.blog.util
;
import
com.alibaba.fastjson.JSON
;
import
org.springframework.util.StringUtils
;
/**
* 缓存key相关的工具类
*
* @author yadong.zhang (yadong.zhang0415(a)gmail.com)
* @version 1.0
* @website https://www.zhyd.me
* @date 2018/5/25 10:23
* @since 1.0
*/
public
class
CacheKeyUtil
{
public
static
String
getMethodParamsKey
(
Object
...
obj
)
{
if
(
StringUtils
.
isEmpty
(
obj
))
{
return
""
;
}
return
"("
+
JSON
.
toJSONString
(
obj
)
+
")"
;
}
}
blog-core/src/main/java/com/zyd/blog/util/RestClientUtil.java
浏览文件 @
7f65b6ff
...
@@ -73,7 +73,7 @@ public class RestClientUtil {
...
@@ -73,7 +73,7 @@ public class RestClientUtil {
*/
*/
public
static
String
request
(
String
method
,
String
urlString
,
Map
<
String
,
Object
>
params
,
String
encode
,
Map
<
String
,
String
>
requestHeader
)
{
public
static
String
request
(
String
method
,
String
urlString
,
Map
<
String
,
Object
>
params
,
String
encode
,
Map
<
String
,
String
>
requestHeader
)
{
// 解决因jdk版本问题造成的SSL请求失败的问题
// 解决因jdk版本问题造成的SSL请求失败的问题
java
.
lang
.
System
.
setProperty
(
"https.protocols"
,
"TLSv1,TLSv1.1,TLSv1.2"
);
System
.
setProperty
(
"https.protocols"
,
"TLSv1,TLSv1.1,TLSv1.2"
);
final
HttpURLConnection
connection
;
final
HttpURLConnection
connection
;
try
{
try
{
connection
=
openConnection
(
urlString
);
connection
=
openConnection
(
urlString
);
...
...
blog-core/src/main/resources/mybatis/SysLinkMapper.xml
浏览文件 @
7f65b6ff
...
@@ -48,7 +48,9 @@
...
@@ -48,7 +48,9 @@
AND t.home_page_display = #{homePageDisplay}
AND t.home_page_display = #{homePageDisplay}
</if>
</if>
ORDER BY
ORDER BY
(t. STATUS > 0) DESC, t. STATUS ASC
(t. STATUS > 0) DESC,
t. STATUS ASC,
t.create_time DESC
</select>
</select>
</mapper>
</mapper>
blog-web/src/main/resources/static/js/zhyd.comment.js
浏览文件 @
7f65b6ff
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录