feat(caching): 实现分布式缓存服务

- 新增 CacheService 和 ICacheService 接口,提供缓存操作功能
- 在 Startup.cs 中配置缓存服务- 更新 appsettings.json,增加 RedisCache 和 CacheSettings 配置- 修改 XCode.config,调整缓存相关设置
This commit is contained in:
jonah.fu
2025-08-14 13:15:50 +08:00
parent 2cf41efc0f
commit 1fbe4fc978
6 changed files with 339 additions and 10 deletions
+8 -8
View File
@@ -7,23 +7,23 @@
<!--SQL目录。设置SQL输出的单独目录,默认为空,SQL输出到当前日志中。生产环境建议输出到站点外单独的SqlLog目录-->
<SQLPath></SQLPath>
<!--SQL执行时间。跟踪SQL执行时间,大于该阀值将输出日志,默认1000毫秒-->
<TraceSQLTime>1000</TraceSQLTime>
<TraceSQLTime>2000</TraceSQLTime>
<!--SQL最大长度。输出日志时的SQL最大长度,超长截断,默认4096,不截断用0-->
<SQLMaxLength>4096</SQLMaxLength>
<!--参数化添删改查。默认关闭-->
<UseParameter>false</UseParameter>
<UseParameter>true</UseParameter>
<!--命令超时。查询执行超时时间,默认0秒不限制-->
<CommandTimeout>0</CommandTimeout>
<CommandTimeout>30</CommandTimeout>
<!--失败重试。执行命令超时后的重试次数,默认0不重试-->
<RetryOnFailure>0</RetryOnFailure>
<RetryOnFailure>3</RetryOnFailure>
<!--数据层缓存。根据sql做缓存,默认0秒-->
<DataCacheExpire>0</DataCacheExpire>
<DataCacheExpire>300</DataCacheExpire>
<!--实体缓存过期。整表缓存实体列表,默认10秒-->
<EntityCacheExpire>10</EntityCacheExpire>
<EntityCacheExpire>600</EntityCacheExpire>
<!--单对象缓存过期。按主键缓存实体,默认10秒-->
<SingleCacheExpire>10</SingleCacheExpire>
<SingleCacheExpire>600</SingleCacheExpire>
<!--扩展属性过期。扩展属性Extends缓存,默认10秒-->
<ExtendExpire>10</ExtendExpire>
<ExtendExpire>300</ExtendExpire>
<!--反向工程。Off 关闭;ReadOnly 只读不执行;On 打开,仅新建;Full 完全,修改删除-->
<Migration>On</Migration>
<!--表名称、字段名大小写格式。Default 根据模型生成;Upper 全大写;Lower 全小写;Underline下划线-->