From 2728235dc770da35242251694a508ecfeeda245b Mon Sep 17 00:00:00 2001 From: wanghu Date: Thu, 3 Sep 2026 08:29:05 +0800 Subject: [PATCH] =?UTF-8?q?dotnet=20=E6=8E=A2=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/YhCore.Service/Impl/LogServiceStub.cs | 18 ------------------ src/YhCore.Service/Interfaces/ILogService.cs | 11 ++++++----- src/YhCore.WebApi/Startup.cs | 5 +++++ 3 files changed, 11 insertions(+), 23 deletions(-) delete mode 100644 src/YhCore.Service/Impl/LogServiceStub.cs diff --git a/src/YhCore.Service/Impl/LogServiceStub.cs b/src/YhCore.Service/Impl/LogServiceStub.cs deleted file mode 100644 index d3478e4..0000000 --- a/src/YhCore.Service/Impl/LogServiceStub.cs +++ /dev/null @@ -1,18 +0,0 @@ -using YhCore.Entity; -using YhCore.Model.Vo; -using YhCore.Service.Interfaces; - -namespace YhCore.Service.Impl -{ - /// - /// 日志查询服务占位实现(框架期保证接口可运行)。 - /// TODO:接入 Repository 层后实现真实查询(按 schId + systemScope 过滤、keyword 模糊匹配、分页)。 - /// - public class LogServiceStub : ILogService - { - public PageVO Search(int schId, string keyword, bool systemScope, int page, int size) - { - return PageVO.Empty(page, size); - } - } -} diff --git a/src/YhCore.Service/Interfaces/ILogService.cs b/src/YhCore.Service/Interfaces/ILogService.cs index 2430e06..2d6f6d5 100644 --- a/src/YhCore.Service/Interfaces/ILogService.cs +++ b/src/YhCore.Service/Interfaces/ILogService.cs @@ -1,3 +1,4 @@ +using System.Threading.Tasks; using YhCore.Entity; using YhCore.Model.Vo; @@ -9,13 +10,13 @@ namespace YhCore.Service.Interfaces public interface ILogService { /// - /// 分页搜索系统审计日志。 + /// 分页搜索系统审计日志(sys_operation_log,按 CreateTime 倒序)。 /// - /// 学校 ID - /// 关键字(可为空) - /// true=系统操作日志(systemSearch);false=普通操作日志(search) + /// 学校 ID(多校隔离) + /// 关键字(可为空;模糊匹配用户名/URI/类方法/参数/异常/操作类型) + /// true=系统操作日志(systemSearch,全量);false=普通操作日志(search,排除查询类) /// 页码,从 0 开始 /// 每页大小 - PageVO Search(int schId, string keyword, bool systemScope, int page, int size); + Task> SearchAsync(int schId, string keyword, bool systemScope, int page, int size); } } diff --git a/src/YhCore.WebApi/Startup.cs b/src/YhCore.WebApi/Startup.cs index c68f92a..b486b13 100644 --- a/src/YhCore.WebApi/Startup.cs +++ b/src/YhCore.WebApi/Startup.cs @@ -99,6 +99,11 @@ namespace YhCore.WebApi // 数据层:默认 SQL Server 主库,DatabaseProvider=MySql 可切换 services.AddDataLayer(Configuration); + // 健康探针:/health(免认证,路径不在 SSO 保护段内),数据库/Redis 各 2 秒超时 + services.AddHealthChecks() + .AddCheck("database", timeout: TimeSpan.FromSeconds(2)) + .AddCheck("redis", timeout: TimeSpan.FromSeconds(2)); + // 仓储与 Dapper 通道(对应 Java Repository 自动装配) services.AddRepositories();