diff --git a/.gitignore b/.gitignore index f3538edd..e4c98abb 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,4 @@ AutoRelease .env.dev .env.prod ._* -openapi \ No newline at end of file +# openapi \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 434630fe..8f6e12e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ +[submodule "backend/openapi"] + path = backend/openapi + url = https://gitee.com/dnftools/dcalcopenapi.git [submodule "images"] path = images url = https://gitee.com/dnftools/dcalcimages.git diff --git a/backend/api/routes/openapi.py b/backend/api/routes/openapi.py index bfbccacd..e429a8b7 100644 --- a/backend/api/routes/openapi.py +++ b/backend/api/routes/openapi.py @@ -38,7 +38,7 @@ async def get_skills_list(redis: RedisDep, skillName: Annotated[str, Param(..., def get_skills(): # This function should retrieve the skills list from the data source # For now, we return a placeholder list - with open('./openapi/skills.json', encoding='utf-8') as f: + with open('./openapi/data/skills.json', encoding='utf-8') as f: skills_data = json.load(f) return skills_data @@ -58,7 +58,7 @@ async def get_cn_skill_info(redis: RedisDep, jobId: Annotated[str, Path(..., des def get_skill_info(): # This function should retrieve the skill info based on job and jobGrow # For now, we return a placeholder dictionary - with open(f'./openapi/{jobId}/{jobGrowId}/cn/skillDetail/{skillId}.json', encoding='utf-8') as f: + with open(f'./openapi/data/{jobId}/{jobGrowId}/cn/skillDetail/{skillId}.json', encoding='utf-8') as f: skill_data = json.load(f) if 'levelInfo' in skill_data and 'optionDesc' in skill_data['levelInfo'] and skill_data['levelInfo']['optionDesc'] is not None: skill_data['levelInfo']['optionDesc'] = replace_placeholders(skill_data['levelInfo']['optionDesc']) diff --git a/backend/core/basic/skill.py b/backend/core/basic/skill.py index 9f560d93..abf3d0de 100644 --- a/backend/core/basic/skill.py +++ b/backend/core/basic/skill.py @@ -20,7 +20,7 @@ def get_data(prefix: str, key: int, func): def get_skill_info(): # This function should retrieve the skill info based on job and jobGrow # For now, we return a placeholder dictionary - with open(f'./openapi/{prefix}.json', encoding='utf-8') as f: + with open(f'./openapi/data/{prefix}.json', encoding='utf-8') as f: skill_data = json.load(f) try: data = [0] + list(map(lambda x: x["optionValue"].get( diff --git a/backend/openapi b/backend/openapi new file mode 160000 index 00000000..5f383c14 --- /dev/null +++ b/backend/openapi @@ -0,0 +1 @@ +Subproject commit 5f383c145438f16d6868414c5053d3246369e54b