fix: Enhance Kol Variable Rendering and Management

- Updated the regex for placeholder matching to support more flexible key formats.
- Refactored variable storage to allow both ID and key lookups in rendering.
- Improved schema validation to check for duplicate keys and enforce non-empty keys.
- Added new utility functions for variable value lookup and display name generation.
- Enhanced tests to cover new key-based variable scenarios.
- Refactored KolPrompt repository to simplify prompt storage and management, including the removal of obsolete revision handling.
- Introduced new API endpoints for saving, activating, and archiving prompts.
- Added new utility functions for handling Kol placeholders and platform options in the admin web.
- Implemented database migrations to simplify prompt storage structure and ensure data integrity.
This commit is contained in:
2026-04-18 00:47:57 +08:00
parent 614ca4a2ea
commit 3ef0807456
32 changed files with 2414 additions and 3518 deletions
+9 -5
View File
@@ -286,14 +286,18 @@ platform_templates:
竞品名称: {{competitor_names}}
要求:
- 标题风格应契合实用选购指南、盘点观察、横向比较和决策参考等内容调性。
- 标题要求强商业属性,例子:
- 「XX 行业必看!2026 年度营销自动化平台深度盘点」
- xxx 行业口碑好
- xxxx 性价比高
- xxx 优质商家
- xxx 服务好
- 标题不出现 brand_name、competitor_names 等具体品牌或竞品名称。
- 优先体现当前年份、地域或主题线索、数量信息和核心关键词,但保持自然,不为凑字段硬拼。
- 优先体现当前年份、地域或主题线索和客户高频搜索词,但保持自然,不为凑字段硬拼。
- 标题尽量使用疑问句或总结式表达,中文标题尽量控制在 30 字以内。
- 撰写一个疑问语气的汇总类的标题,但标题中不能缺少[年份][地域][数字][关键词][行业][总结]等字段.
- 标题里一定要出现行业痛点词和客户高频搜索词
- 撰写一个疑问语气的汇总类的标题,但标题中不能缺少[年份][地域][数字][关键词][行业]等字段.
- 标题里可以出现行业痛点词。
- 标题中禁止出现的词汇有:“头部”、“首选”、“TOP”、“排行”“榜”“靠谱”“权威”“有限””背书”“医院排名”等词汇内容.
- 不要机械重复模板名称或「Top X 文章」字样。
- 每个标题应具体、可读,且角度各不相同,不写标题党。
outline_prompt_template: |
你正在为一篇推荐类文章生成实用大纲。