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:
+2
@@ -25,4 +25,6 @@ public interface ISysLoginLogRepository {
|
||||
Mono<SysLoginLog> findById(Long id);
|
||||
|
||||
Mono<Long> count();
|
||||
|
||||
Mono<Long> countToday();
|
||||
}
|
||||
+1
@@ -22,4 +22,5 @@ public interface ISysLoginLogService {
|
||||
Mono<SysLoginLog> save(SysLoginLog loginLog);
|
||||
Mono<PageResponse<SysLoginLog>> findLoginLogsByPage(PageRequest pageRequest);
|
||||
Mono<Long> count();
|
||||
Mono<Long> countToday();
|
||||
}
|
||||
|
||||
+8
@@ -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();
|
||||
}
|
||||
}
|
||||
+6
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user