init
This commit is contained in:
@@ -10,5 +10,5 @@ register_gzip_request(router)
|
||||
|
||||
|
||||
@router.post('/calc')
|
||||
async def calc(state: AltersDep, config=Body(None)):
|
||||
def calc(state: AltersDep, config=Body(None)):
|
||||
return response(data=calculate(state, config))
|
||||
|
||||
@@ -5,7 +5,7 @@ from api.core.Response import response
|
||||
from api.core.Redis import get_redis_info
|
||||
from api.dp import RedisDep
|
||||
from api.utils.skill_detail import SKILL_DETAIL_NORMALIZE_VERSION, normalize_skill_detail, skill_detail_for_level
|
||||
from api.utils.openapi_data import openapi_locale_path
|
||||
from api.utils.openapi_data import OPENAPI_SKILLS_PATH, OPENAPI_SUMMARY_DIR, openapi_locale_path
|
||||
from api.utils.skill_tree import (
|
||||
SKILL_TREE_WITH_DESC_SPECIAL_VERSION,
|
||||
filter_skill_tree_by_desc_special,
|
||||
@@ -43,7 +43,7 @@ async def get_skills_list(
|
||||
def get_skills():
|
||||
# This function should retrieve the skills list from the data source
|
||||
# For now, we return a placeholder list
|
||||
with open('./openapi/data/skills.json', encoding='utf-8') as f:
|
||||
with OPENAPI_SKILLS_PATH.open(encoding='utf-8') as f:
|
||||
skills_data = json.load(f)
|
||||
return skills_data
|
||||
|
||||
@@ -226,13 +226,12 @@ async def get_skill_data_summary(
|
||||
def get_skill_data_summary():
|
||||
# This function should retrieve the skill data summary based on job
|
||||
# For now, we return a placeholder dictionary
|
||||
summary_dir = './openapi/summary/'
|
||||
json_files = [f for f in os.listdir(summary_dir) if f.endswith('.json')]
|
||||
json_files = [f for f in os.listdir(OPENAPI_SUMMARY_DIR) if f.endswith('.json')]
|
||||
res = []
|
||||
for i in json_files:
|
||||
if job in i:
|
||||
k = re.search(r'^\d+(?:-\d+)?(.*?)_', i)
|
||||
with open(os.path.join(summary_dir, i), encoding='utf-8') as f:
|
||||
with (OPENAPI_SUMMARY_DIR / i).open(encoding='utf-8') as f:
|
||||
skill_data = json.load(f)
|
||||
weapon = i.split('_')[-1].replace('.json', '')
|
||||
res.append({'weapon': weapon if weapon else '通用', 'skills': skill_data, 'job': k.group(1) if k else ''})
|
||||
|
||||
Reference in New Issue
Block a user