feat:完善加点代码导入

This commit is contained in:
2026-09-14 14:53:05 +08:00
parent e65dfef083
commit 9453106dc1
5 changed files with 394 additions and 141 deletions
+14
View File
@@ -6,6 +6,20 @@ from api.utils.openapi_data import openapi_locale_path
SKILL_TREE_WITH_DESC_SPECIAL_VERSION = 'skillTreeWithDescSpecial:v1'
SKILL_TREE_NAME_MAP_VERSION = 'skillTreeNameMap:v1'
SKILL_TREE_MAP_VERSION = 'skillTreeMap:v1'
@cache
def load_skill_tree_map(job_id: str, job_grow_id: str) -> dict[str, dict]:
"""按 OpenAPI 数字 ID 索引技能树,保留 autoLevel 等元数据。调用方只读。"""
skill_tree_path = openapi_locale_path('cn', job_id, job_grow_id, 'skill_tree.json')
with skill_tree_path.open(encoding='utf-8') as file:
skills_data = json.load(file)
return {
str(skill['id']): skill
for skill in skills_data
if skill.get('id') is not None and skill.get('name') is not None
}
@cache