接口类对象解析

This commit is contained in:
2026-06-05 16:35:51 +08:00
parent 3cba3bb74e
commit 03fb9766a6
7 changed files with 192 additions and 49 deletions

View File

@@ -25,19 +25,19 @@ def filter_endpoints_by_files(
def parse_endpoints_from_files(
repo_root: Path,
source_subdir: str,
source_subdirs: List[str],
file_paths: List[str],
file_contents: Dict[str, str],
) -> List[ApiEndpoint]:
"""
解析指定 Controller 文件,提取接口参数(仅解析传入文件,不全量扫描)。
:param repo_root: 仓库根
:param source_subdir: 源码目录(相对仓库根)
:param file_paths: 文件路径列表
:param file_contents: 路径 -> 源码内容
:param repo_root: 仓库根
:param source_subdirs: 源码目录列表(相对仓库根)
:param file_paths: 文件路径列表
:param file_contents: 路径 -> 源码内容
:return: ApiEndpoint 列表
"""
from controller_ast_parser import parse_controller_files
return parse_controller_files(repo_root, source_subdir, file_paths, file_contents)
return parse_controller_files(repo_root, source_subdirs, file_paths, file_contents)