重构小程序图标组件,替换传统 emoji 为 SVG 图标,提升视觉一致性和可维护性。更新多个页面以使用新图标组件,优化用户界面体验。同时,调整了数据加载逻辑,确保更高效的状态管理和用户交互。
This commit is contained in:
14
soul-api/internal/cache/cache.go
vendored
14
soul-api/internal/cache/cache.go
vendored
@@ -44,6 +44,9 @@ func KeyBookHot(limit int) string { return "soul:book:hot:" + fmt.Sprint(limit)
|
||||
const KeyBookRecommended = "soul:book:recommended"
|
||||
const KeyBookStats = "soul:book:stats"
|
||||
const KeyConfigMiniprogram = "soul:config:miniprogram"
|
||||
const KeyConfigAuditMode = "soul:config:audit-mode"
|
||||
const KeyConfigCore = "soul:config:core"
|
||||
const KeyConfigReadExtras = "soul:config:read-extras"
|
||||
|
||||
// Get 从 Redis 读取,未配置或失败返回 nil(调用方回退 DB)
|
||||
func Get(ctx context.Context, key string, dest interface{}) bool {
|
||||
@@ -156,9 +159,13 @@ func InvalidateBookCache() {
|
||||
}
|
||||
}
|
||||
|
||||
// InvalidateConfig 配置变更时调用,使小程序 config 缓存失效
|
||||
// InvalidateConfig 配置变更时调用,使小程序 config 及拆分接口缓存失效
|
||||
func InvalidateConfig() {
|
||||
Del(context.Background(), KeyConfigMiniprogram)
|
||||
ctx := context.Background()
|
||||
Del(ctx, KeyConfigMiniprogram)
|
||||
Del(ctx, KeyConfigAuditMode)
|
||||
Del(ctx, KeyConfigCore)
|
||||
Del(ctx, KeyConfigReadExtras)
|
||||
}
|
||||
|
||||
// BookRelatedTTL 书籍相关接口 TTL(hot/recommended/stats)
|
||||
@@ -167,6 +174,9 @@ const BookRelatedTTL = 5 * time.Minute
|
||||
// ConfigTTL 配置接口 TTL
|
||||
const ConfigTTL = 10 * time.Minute
|
||||
|
||||
// AuditModeTTL 审核模式 TTL,管理端开关后需较快生效
|
||||
const AuditModeTTL = 1 * time.Minute
|
||||
|
||||
// KeyChapterContent 章节正文缓存,格式 soul:chapter:content:{mid},存原始 HTML 字符串
|
||||
func KeyChapterContent(mid int) string { return "soul:chapter:content:" + fmt.Sprint(mid) }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user