Files
AI-Check-Test/.gitea/checker/models.py
dongzi 5a57c32558
All checks were successful
API接口参数变更检测 / api-param-check (push) Successful in 21s
脚本修改
2026-06-03 15:33:52 +08:00

34 lines
643 B
Python

"""
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}"