feat:完善加点代码导入
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user