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
@@ -0,0 +1,31 @@
|
||||
"""Export Dify-compatible OpenAPI for File Check tools paste/import."""
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
sys.path.insert(0, str(ROOT / "backend"))
|
||||
|
||||
from app.services.file_check_tools.openapi_spec import build_file_check_openapi_spec
|
||||
|
||||
|
||||
def main() -> None:
|
||||
base = (
|
||||
os.getenv("HXOPS_TOOLS_API_BASE")
|
||||
or os.getenv("PUBLIC_BASE_URL")
|
||||
or "http://127.0.0.1:5052"
|
||||
).rstrip("/")
|
||||
spec = build_file_check_openapi_spec(base)
|
||||
out_dir = ROOT / "docs" / "openapi"
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
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/file-check/tools/openapi.json")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user