Refactor: Move API files (#15151)

Refactor: Move API files
This commit is contained in:
Wang Qi
2026-05-22 17:44:05 +08:00
committed by GitHub
parent 7e6844118b
commit 87918650ff
11 changed files with 305 additions and 481 deletions

View File

@@ -308,9 +308,8 @@ def register_page(page_path):
sys.modules[module_name] = page
spec.loader.exec_module(page)
page_name = getattr(page, "page_name", page_name)
sdk_path = "\\sdk\\" if sys.platform.startswith("win") else "/sdk/"
restful_api_path = "\\restful_apis\\" if sys.platform.startswith("win") else "/restful_apis/"
url_prefix = f"/api/{API_VERSION}" if sdk_path in path or restful_api_path in path else f"/{API_VERSION}/{page_name}"
url_prefix = f"/api/{API_VERSION}" if restful_api_path in path else f"/{API_VERSION}/{page_name}"
app.register_blueprint(page.manager, url_prefix=url_prefix)
return url_prefix