docs: 补全全部缺失的 XML 文档注释(中文)
- 为全部 5 个项目(Avalonia-API、Avalonia-Common、Avalonia-EFCore、 Avalonia-PC、Avalonia-Services)中缺失注释的类、方法、属性、字段、 接口成员等补全中文 XML 文档注释 - 共修改约 37 个文件,补全约 220+ 处注释 - 修复 ServiceEndpointCollection.cs 中 MapDelete<TService> 语法错误 - 修复 PcAuthService.cs 中 const prefix 位置错乱导致编译失败的问题 - 扫描结果:缺失项 0 - 构建结果:4/4 项目编译通过
This commit is contained in:
@@ -8,8 +8,17 @@ namespace Avalonia_Services.Extensions
|
||||
/// </summary>
|
||||
public class DesktopEndpointAdapter
|
||||
{
|
||||
/// <summary>
|
||||
/// 统一端点集合。
|
||||
/// </summary>
|
||||
private readonly ServiceEndpointCollection _endpoints;
|
||||
/// <summary>
|
||||
/// 鉴权服务。
|
||||
/// </summary>
|
||||
private readonly IAuthService _authService;
|
||||
/// <summary>
|
||||
/// DI 服务提供程序。
|
||||
/// </summary>
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
|
||||
/// <summary>
|
||||
@@ -17,12 +26,33 @@ namespace Avalonia_Services.Extensions
|
||||
/// </summary>
|
||||
public class RouteResult
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取是否匹配到路由。
|
||||
/// </summary>
|
||||
public bool IsMatched { get; init; }
|
||||
/// <summary>
|
||||
/// 获取 HTTP 状态码。
|
||||
/// </summary>
|
||||
public int StatusCode { get; init; } = 200;
|
||||
public string StatusMessage { get; init; } = "OK";
|
||||
/// <summary>
|
||||
/// 获取状态描述文本。
|
||||
/// </summary>
|
||||
public string StatusMessage { get; init; } = "";
|
||||
/// <summary>
|
||||
/// 获取响应数据。
|
||||
/// </summary>
|
||||
public object? Data { get; init; }
|
||||
/// <summary>
|
||||
/// 获取响应头字典。
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ResponseHeaders { get; init; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 创建成功响应结果。
|
||||
/// </summary>
|
||||
/// <param name="data">响应数据。</param>
|
||||
/// <param name="ctx">端点上下文。</param>
|
||||
/// <returns>路由结果。</returns>
|
||||
public static RouteResult Success(object? data, ServiceEndpointContext ctx)
|
||||
{
|
||||
return new RouteResult
|
||||
@@ -35,6 +65,10 @@ namespace Avalonia_Services.Extensions
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 创建 404 未找到响应。
|
||||
/// </summary>
|
||||
/// <returns>表示未匹配的路由结果。</returns>
|
||||
public static RouteResult NotFound() => new()
|
||||
{
|
||||
IsMatched = false,
|
||||
@@ -43,6 +77,12 @@ namespace Avalonia_Services.Extensions
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化桌面端点适配器。
|
||||
/// </summary>
|
||||
/// <param name="endpoints">端点集合。</param>
|
||||
/// <param name="authService">鉴权服务。</param>
|
||||
/// <param name="serviceProvider">DI 服务提供程序。</param>
|
||||
public DesktopEndpointAdapter(
|
||||
ServiceEndpointCollection endpoints,
|
||||
IAuthService authService,
|
||||
|
||||
Reference in New Issue
Block a user