feat(登录日志): 添加今日登录次数统计功能

新增今日登录次数统计接口,修复Dashboard显示问题
- 在ISysLoginLogService接口添加countToday方法
- 实现SysLoginLogService中的countToday逻辑
- 更新ISysLoginLogRepository接口
- 添加SysLogHandler中的getTodayLoginCount方法
- 在SystemRouter中配置新路由端点

fix(测试): 更新系统配置URL匹配规则
- 将uat-phase1.spec.ts中的sysconfig改为sys/config

docs: 添加E2E测试报告和Dashboard问题诊断文档
This commit is contained in:
张翔
2026-03-24 17:12:10 +08:00
parent 3d6a0bd7b8
commit 31d66103e4
14 changed files with 543 additions and 8 deletions
@@ -25,4 +25,6 @@ public interface ISysLoginLogRepository {
Mono<SysLoginLog> findById(Long id);
Mono<Long> count();
Mono<Long> countToday();
}
@@ -22,4 +22,5 @@ public interface ISysLoginLogService {
Mono<SysLoginLog> save(SysLoginLog loginLog);
Mono<PageResponse<SysLoginLog>> findLoginLogsByPage(PageRequest pageRequest);
Mono<Long> count();
Mono<Long> countToday();
}
@@ -127,4 +127,12 @@ public class SysLoginLogService implements ISysLoginLogService {
public Mono<Long> count() {
return repository.count();
}
@Override
public Mono<Long> countToday() {
LocalDateTime todayStart = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0);
LocalDateTime todayEnd = todayStart.plusDays(1);
return repository.findByLoginTimeBetweenOrderByLoginTimeDesc(todayStart, todayEnd)
.count();
}
}
@@ -77,6 +77,12 @@ public class SysLogHandler {
.flatMap(count -> ServerResponse.ok().bodyValue(count));
}
@Operation(summary = "获取今日登录次数", description = "获取今日登录次数统计")
public Mono<ServerResponse> getTodayLoginCount(ServerRequest request) {
return loginLogService.countToday()
.flatMap(count -> ServerResponse.ok().bodyValue(count));
}
@Operation(summary = "获取所有异常日志", description = "获取系统中所有异常日志列表")
public Mono<ServerResponse> getAllExceptionLogs(ServerRequest request) {
return ServerResponse.ok()