feat(file-check): 新增文件检核相关 API 和工具,替换 RoHS 检核功能
This commit is contained in:
1 parent
fa0cdee8df
commit
24310b63b3
35 files changed
+3066
-659
No files matched your search
+5
-5
@@ -1,4 +1,4 @@
|
||||
"""Export Dify-compatible OpenAPI for RoHS Check tools paste/import."""
|
||||
"""Export Dify-compatible OpenAPI for File Check tools paste/import."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
@@ -9,7 +9,7 @@ from pathlib import Path
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT / "backend"))
|
||||
|
||||
from app.services.rohs_check_tools.openapi_spec import build_rohs_openapi_spec
|
||||
from app.services.file_check_tools.openapi_spec import build_file_check_openapi_spec
|
||||
|
||||
|
||||
def main() -> None:
|
||||
@@ -18,13 +18,13 @@ def main() -> None:
|
||||
or os.getenv("PUBLIC_BASE_URL")
|
||||
or "http://127.0.0.1:5052"
|
||||
).rstrip("/")
|
||||
spec = build_rohs_openapi_spec(base)
|
||||
spec = build_file_check_openapi_spec(base)
|
||||
out_dir = ROOT / "docs" / "openapi"
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
json_path = out_dir / "rohs_check_tools_openapi.json"
|
||||
json_path = out_dir / "file_check_tools_openapi.json"
|
||||
json_path.write_text(json.dumps(spec, ensure_ascii=False, indent=2), encoding="utf-8")
|
||||
print(f"Wrote {json_path}")
|
||||
print(f"Import URL: {base}/api/rohs-check/tools/openapi.json")
|
||||
print(f"Import URL: {base}/api/file-check/tools/openapi.json")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
Reference in new issue
Block a user