commit e3fe965f108e748a0bfa13f6f122d650d73575d9
Author: luoqian <2769838458@qq.com>
Date: Thu May 21 15:52:36 2026 +0800
init
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
new file mode 100644
index 0000000..9755770
--- /dev/null
+++ b/.config/dotnet-tools.json
@@ -0,0 +1,13 @@
+{
+ "version": 1,
+ "isRoot": true,
+ "tools": {
+ "dotnet-ef": {
+ "version": "10.0.7",
+ "commands": [
+ "dotnet-ef"
+ ],
+ "rollForward": false
+ }
+ }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..15db508
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,30 @@
+################################################################################
+# 此 .gitignore 文件已由 Microsoft(R) Visual Studio 自动创建。
+################################################################################
+
+/Avalonia-PC/bin
+/Avalonia-PC/.vs
+/Avalonia-PC/obj
+/Avalonia-API/bin
+/Avalonia-API/obj
+/Avalonia-Services/bin
+/Avalonia-Services/obj
+/Avalonia-Web-VUE/.vscode
+/Avalonia-Web-VUE/obj
+/Avalonia-Web-VUE/node_modules
+/Avalonia-Web-VUE/dist
+/Avalonia-Web-VUE/.vscode
+/avalonia-web-react/obj
+/avalonia-web-react/obj
+/avalonia-web-react/node_modules
+/avalonia-web-react/dist
+/Avalonia-EFCore/bin
+/Avalonia-EFCore/obj
+/Avalonia-Common/bin
+/Avalonia-Common/obj
+/Avalonia-API/logs
+/Avalonia-API/avalonia-api.db
+/Avalonia-API/avalonia-api.db-shm
+/Avalonia-API/avalonia-api.db-wal
+/package-output
+/package-scripts/tools
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..7c24122
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,7 @@
+{
+ "chat.tools.terminal.autoApprove": {
+ "ForEach-Object": true,
+ "dotnet list": true,
+ "dotnet build": true
+ }
+}
\ No newline at end of file
diff --git a/Avalonia-API/Authentication/ApiAuthEndpointService.cs b/Avalonia-API/Authentication/ApiAuthEndpointService.cs
new file mode 100644
index 0000000..8c97530
--- /dev/null
+++ b/Avalonia-API/Authentication/ApiAuthEndpointService.cs
@@ -0,0 +1,160 @@
+using Avalonia_Common.Core;
+using Avalonia_EFCore.Database;
+using Avalonia_EFCore.Models;
+using Avalonia_Services.Core;
+using Avalonia_Services.Services.AuthService;
+using Microsoft.EntityFrameworkCore;
+using System.Text.Json;
+
+namespace Avalonia_API.Authentication
+{
+ ///
+ /// API 鉴权端点服务,实现 ,
+ /// 处理登录、刷新 Token 和登出操作,使用 JWT 与 Refresh Token 机制。
+ ///
+ public sealed class ApiAuthEndpointService(
+ AppDataContext db,
+ JwtTokenService jwtTokenService,
+ RefreshTokenService refreshTokenService) : IApiAuthEndpointService
+ {
+ private static readonly JsonSerializerOptions JsonOptions = new()
+ {
+ PropertyNameCaseInsensitive = true,
+ };
+
+ ///
+ /// 处理用户登录请求。根据账号(邮箱或用户名)查找或创建用户,
+ /// 生成 JWT Access Token 和 Refresh Token 并返回。
+ ///
+ /// 服务端点上下文,包含请求体、请求头等信息。
+ /// 包含 AccessToken、RefreshToken 及过期时间的认证响应。
+ public async Task