量产音频: 实现 GetHot 并调整 GetAudio/GetAudioTag 契约与独立 Redis - #67
Merged
Conversation
量产 AudioService 补齐热点搜索,并收敛 GetAudio / GetAudioTag 对外契约;量产 Redis 与功能手板/HTTP 物理隔离。 ## GetHot - 新增 GetHot:从独立量产 Redis ZSET 读取 Top N,返回 keyword + score - GetAudio 在有 query_text 时异步记账(Redis 计数 + ES 搜索事件明细),失败不阻断主流程 - 搜索词仅做 strip 清洗,不做语义归一;关闭前排空热点后台任务 ## GetAudio - 响应改为顶层 list / page / page_size / total - list 项仅返回 id、audio_name、audio_url、cover_url、description、vip - vip 为 int32,缺省显式返回 0 - query_text 匹配全部 content_form 标签(含二级);无命中物料时返回空列表,不回退父级标签 - 默认相似度阈值调整为 0.75 ## GetAudioTag - TagDictItem 新增 id、parent_tag_id、status - parent_tag_id 为 null 时 JSON 显式返回 null - 查库仅返回 type=content_form、启用、且无父级的一级标签 ## Redis / 部署 - 量产仅使用 SOMNI_REDIS_URL,不再回退 REDIS_URL - 启动时探测量产 Redis;读写超时与 GetHot 故障映射为 UNAVAILABLE - docker-compose 新增独立持久化 redis-somni 服务 ## 测试 - 补充/更新 proto、catalog、hot、gRPC 相关单测 Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetHot:GetAudio 有搜索词时异步写入 Redis ZSET + ES 搜索事件,GetHot 返回 Top Nkeyword/scoreGetAudio契约为顶层list/page/page_size/total,列表项仅含id/audio_name/audio_url/cover_url/description/vip(vip 缺省为 0);搜索匹配全部 content_form 标签,无命中返回空列表GetAudioTag:返回id/parent_tag_id/status,parent_tag_id为 null 时显式返回 null;查库仅type=content_form一级启用标签SOMNI_REDIS_URL,与功能手板/HTTP 的REDIS_URL隔离;docker-compose 新增redis-somniTest plan
SOMNI_REDIS_URL后启动服务,日志出现「已连接量产独立 Redis」GetAudio带query_text=雨声,再调GetHot,可见对应 keyword/score 增长;热点 key 只落在量产 RedisGetAudio响应仅含list/page/page_size/total,list 项六字段,vip为数字 0/1GetAudioTag仅返回 content_form 一级标签,根标签parent_tag_id为 nullSOMNI_REDIS_URL为空时 GetHot 返回 UNAVAILABLE,GetAudio 主流程不受热点记账失败影响Made with Cursor