脚本修改
All checks were successful
API接口参数变更检测 / api-param-check (push) Successful in 21s

This commit is contained in:
2026-06-03 15:33:52 +08:00
parent 2c20a26af8
commit 5a57c32558
2 changed files with 395 additions and 0 deletions

33
.gitea/checker/models.py Normal file
View File

@@ -0,0 +1,33 @@
"""
Controller 端点数据模型。
"""
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass
class ApiParameter:
"""单个接口参数。"""
name: str
type: str
required: bool = True
source: str = "query"
description: Optional[str] = None
@dataclass
class ApiEndpoint:
"""单个 Controller 接口端点。"""
http_method: str
uri: str
controller_class: str
method_name: str
source_file: str
parameters: List[ApiParameter] = field(default_factory=list)
@property
def endpoint_key(self) -> str:
return f"{self.http_method} {self.uri}"