Merge pull request #7050 from DDSRem-Dev/codex-comment-migration

docs: 统一全项目中文注释和结构化契约说明
This commit is contained in:
DDSRem
2026-10-17 19:26:29 +08:00
committed by GitHub
parent 3c7431b7da
commit 2de976f6b3
2345 changed files with 143990 additions and 61534 deletions

View File

@@ -1,4 +1,6 @@
"""GitHub 授权 API 的应用服务依赖。"""
"""
GitHub 授权 API 的应用服务依赖。
"""
from fastapi import Depends, HTTPException
@@ -11,7 +13,9 @@ from app.startup.composition.context import HostRuntime
def get_github_auth_service(
runtime: HostRuntime = Depends(get_host_runtime),
) -> GithubAuthService:
"""从宿主运行时取得已装配的 GitHub 授权应用服务。"""
"""
从宿主运行时取得已装配的 GitHub 授权应用服务。
"""
if runtime.system.github_auth is None:
raise HTTPException(status_code=503, detail="GitHub 授权服务尚未初始化")
return runtime.system.github_auth
@@ -20,7 +24,9 @@ def get_github_auth_service(
def get_community_medal_service(
runtime: HostRuntime = Depends(get_host_runtime),
) -> CommunityMedalService:
"""复用实例启动装配的社区勋章服务,不在请求中构造网络客户端或缓存。"""
"""
复用实例启动装配的社区勋章服务,不在请求中构造网络客户端或缓存。
"""
if runtime.system.github_community is None:
raise HTTPException(status_code=503, detail="社区勋章服务尚未初始化")
return runtime.system.github_community