Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
iBiz4j Spring R7
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
iBiz-R7后台标准模板
iBiz4j Spring R7
提交
70eaecf3
提交
70eaecf3
编写于
5月 15, 2020
作者:
zhouweidong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
缓存配置
上级
ab07d656
变更
6
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
CaffeineCacheConfig.java.ftl
...ava/%SYS_PKGPATH%/util/cache/CaffeineCacheConfig.java.ftl
+2
-2
RedisCacheConfig.java.ftl
...n/java/%SYS_PKGPATH%/util/cache/RedisCacheConfig.java.ftl
+2
-2
CaffeineCacheManager.java.ftl
...TH%/util/cache/cacheManager/CaffeineCacheManager.java.ftl
+2
-2
LayeringCacheManager.java.ftl
...TH%/util/cache/cacheManager/LayeringCacheManager.java.ftl
+2
-2
RedisMessageListener.java.ftl
...KGPATH%/util/cache/listener/RedisMessageListener.java.ftl
+2
-2
application-sys.yml.ftl
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
+3
-3
未找到文件。
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/cache/CaffeineCacheConfig.java.ftl
浏览文件 @
70eaecf3
...
@@ -7,7 +7,7 @@ import com.github.benmanes.caffeine.cache.CaffeineSpec;
...
@@ -7,7 +7,7 @@ import com.github.benmanes.caffeine.cache.CaffeineSpec;
import
${
pub
.
getPKGCodeName
()}.
util
.
cache
.
cacheManager
.
CaffeineCacheManager
;
import
${
pub
.
getPKGCodeName
()}.
util
.
cache
.
cacheManager
.
CaffeineCacheManager
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
boot
.
autoconfigure
.
cache
.
CacheProperties
;
import
org
.
springframework
.
boot
.
autoconfigure
.
cache
.
CacheProperties
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Property
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Expression
;
import
org
.
springframework
.
boot
.
context
.
properties
.
EnableConfigurationProperties
;
import
org
.
springframework
.
boot
.
context
.
properties
.
EnableConfigurationProperties
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
annotation
.
EnableCaching
;
import
org
.
springframework
.
cache
.
annotation
.
EnableCaching
;
...
@@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
...
@@ -22,7 +22,7 @@ import org.springframework.util.StringUtils;
@
EnableCaching
@
EnableCaching
@
Configuration
@
Configuration
@
EnableConfigurationProperties
(
CacheProperties
.
class
)
@
EnableConfigurationProperties
(
CacheProperties
.
class
)
@
ConditionalOn
Property
(
"ibiz.enableCaffeineCache
"
)
@
ConditionalOn
Expression
(
"'${r'${ibiz.cacheLevel:None}'}'.equals('oneLevel')
"
)
public
class
CaffeineCacheConfig
{
public
class
CaffeineCacheConfig
{
@
Autowired
@
Autowired
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/cache/RedisCacheConfig.java.ftl
浏览文件 @
70eaecf3
...
@@ -14,7 +14,7 @@ import ${pub.getPKGCodeName()}.util.cache.redis.StringRedisSerializer;
...
@@ -14,7 +14,7 @@ import ${pub.getPKGCodeName()}.util.cache.redis.StringRedisSerializer;
import
${
pub
.
getPKGCodeName
()}.
util
.
enums
.
RedisChannelTopic
;
import
${
pub
.
getPKGCodeName
()}.
util
.
enums
.
RedisChannelTopic
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
boot
.
autoconfigure
.
cache
.
CacheProperties
;
import
org
.
springframework
.
boot
.
autoconfigure
.
cache
.
CacheProperties
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Property
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Expression
;
import
org
.
springframework
.
boot
.
context
.
properties
.
EnableConfigurationProperties
;
import
org
.
springframework
.
boot
.
context
.
properties
.
EnableConfigurationProperties
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
annotation
.
EnableCaching
;
import
org
.
springframework
.
cache
.
annotation
.
EnableCaching
;
...
@@ -39,7 +39,7 @@ import org.springframework.util.StringUtils;
...
@@ -39,7 +39,7 @@ import org.springframework.util.StringUtils;
@
EnableCaching
@
EnableCaching
@
Configuration
@
Configuration
@
EnableConfigurationProperties
(
CacheProperties
.
class
)
@
EnableConfigurationProperties
(
CacheProperties
.
class
)
@
ConditionalOn
Property
(
"ibiz.enableRedisCache
"
)
@
ConditionalOn
Expression
(
"'${r'${ibiz.cacheLevel:None}'}'.equals('twoLevel')
"
)
public
class
RedisCacheConfig
{
public
class
RedisCacheConfig
{
@
Autowired
@
Autowired
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/cache/cacheManager/CaffeineCacheManager.java.ftl
浏览文件 @
70eaecf3
...
@@ -6,7 +6,7 @@ package ${pub.getPKGCodeName()}.util.cache.cacheManager;
...
@@ -6,7 +6,7 @@ package ${pub.getPKGCodeName()}.util.cache.cacheManager;
import
com
.
github
.
benmanes
.
caffeine
.
cache
.
Caffeine
;
import
com
.
github
.
benmanes
.
caffeine
.
cache
.
Caffeine
;
import
com
.
github
.
benmanes
.
caffeine
.
cache
.
CaffeineSpec
;
import
com
.
github
.
benmanes
.
caffeine
.
cache
.
CaffeineSpec
;
import
lombok
.
Data
;
import
lombok
.
Data
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Property
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Expression
;
import
org
.
springframework
.
cache
.
Cache
;
import
org
.
springframework
.
cache
.
Cache
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
caffeine
.
CaffeineCache
;
import
org
.
springframework
.
cache
.
caffeine
.
CaffeineCache
;
...
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -25,7 +25,7 @@ import java.util.concurrent.TimeUnit;
*/
*/
@
Data
@
Data
@
Component
@
Component
@
ConditionalOn
Property
(
"ibiz.enableCaffeineCache
"
)
@
ConditionalOn
Expression
(
"'${r'${ibiz.cacheLevel:None}'}'.equals('oneLevel')
"
)
public
class
CaffeineCacheManager
implements
CacheManager
{
public
class
CaffeineCacheManager
implements
CacheManager
{
private
static
final
int
DEFAULT_EXPIRE_AFTER_WRITE
=
1
;
private
static
final
int
DEFAULT_EXPIRE_AFTER_WRITE
=
1
;
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/cache/cacheManager/LayeringCacheManager.java.ftl
浏览文件 @
70eaecf3
...
@@ -8,7 +8,7 @@ import com.github.benmanes.caffeine.cache.CaffeineSpec;
...
@@ -8,7 +8,7 @@ import com.github.benmanes.caffeine.cache.CaffeineSpec;
import
lombok
.
Data
;
import
lombok
.
Data
;
import
${
pub
.
getPKGCodeName
()}.
util
.
cache
.
cache
.
LayeringCache
;
import
${
pub
.
getPKGCodeName
()}.
util
.
cache
.
cache
.
LayeringCache
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Property
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Expression
;
import
org
.
springframework
.
cache
.
Cache
;
import
org
.
springframework
.
cache
.
Cache
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
data
.
redis
.
cache
.
RedisCacheConfiguration
;
import
org
.
springframework
.
data
.
redis
.
cache
.
RedisCacheConfiguration
;
...
@@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit;
...
@@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit;
*/
*/
@
Data
@
Data
@
Component
@
Component
@
ConditionalOn
Property
(
"ibiz.enableRedisCache
"
)
@
ConditionalOn
Expression
(
"'${r'${ibiz.cacheLevel:None}'}'.equals('twoLevel')
"
)
public
class
LayeringCacheManager
implements
CacheManager
{
public
class
LayeringCacheManager
implements
CacheManager
{
private
static
final
int
DEFAULT_EXPIRE_AFTER_WRITE
=
1
;
private
static
final
int
DEFAULT_EXPIRE_AFTER_WRITE
=
1
;
...
...
SLN/%PUBPRJ%-util/src/main/java/%SYS_PKGPATH%/util/cache/listener/RedisMessageListener.java.ftl
浏览文件 @
70eaecf3
...
@@ -8,7 +8,7 @@ import ${pub.getPKGCodeName()}.util.enums.RedisChannelTopic;
...
@@ -8,7 +8,7 @@ import ${pub.getPKGCodeName()}.util.enums.RedisChannelTopic;
import
org
.
slf4j
.
Logger
;
import
org
.
slf4j
.
Logger
;
import
org
.
slf4j
.
LoggerFactory
;
import
org
.
slf4j
.
LoggerFactory
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Property
;
import
org
.
springframework
.
boot
.
autoconfigure
.
condition
.
ConditionalOn
Expression
;
import
org
.
springframework
.
cache
.
Cache
;
import
org
.
springframework
.
cache
.
Cache
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
cache
.
CacheManager
;
import
org
.
springframework
.
data
.
redis
.
connection
.
Message
;
import
org
.
springframework
.
data
.
redis
.
connection
.
Message
;
...
@@ -25,7 +25,7 @@ import java.util.Map;
...
@@ -25,7 +25,7 @@ import java.util.Map;
*/
*/
@
Component
@
Component
@
ConditionalOn
Property
(
"ibiz.enableRedisCache
"
)
@
ConditionalOn
Expression
(
"'${r'${ibiz.cacheLevel:None}'}'.equals('twoLevel')
"
)
public
class
RedisMessageListener
extends
MessageListenerAdapter
{
public
class
RedisMessageListener
extends
MessageListenerAdapter
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RedisPublisher
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
RedisPublisher
.
class
);
@
Autowired
@
Autowired
...
...
SLN/%PUBPRJ%-util/src/main/resources/application-sys.yml.ftl
浏览文件 @
70eaecf3
...
@@ -203,12 +203,12 @@ ribbon:
...
@@ -203,12 +203,12 @@ ribbon:
<#assign enableDataAcc="false">
<#assign enableDataAcc="false">
#系统是否开启权限验证、是否开启缓存
#系统是否开启权限验证、是否开启缓存
#缓存
模式:关闭缓存(无配置项)、本地缓存(enableCaffeineCache=true-默认)、caffeine+redis两级缓存(enableRedisCache=true
)
#缓存
级别:无缓存(无配置项)、一级缓存(oneLevel)、二级缓存(twoLevel
)
ibiz:
ibiz:
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
<#assign enableDataAcc="true">
<#assign enableDataAcc="true">
</#if>
</#if>
enablePermissionValid: ${enableDataAcc}
enablePermissionValid: ${enableDataAcc}
enableCaffeineCache: true
cacheLevel: oneLevel #一级缓存,本地caffeine缓存
#
enableRedisCache: ${enableDataAcc}
#
cacheLevel: twoLevel #二级缓存,本地caffeine缓存+Redis缓存
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录