Compare commits

..

No commits in common. "28941ede414263f0705115f769b6be92fa8fc392" and "e0f47ce1b6bab95497e2b2f8f7db588e5fb0aefb" have entirely different histories.

2 changed files with 8 additions and 15 deletions

View File

@ -260,8 +260,4 @@ mvn test -pl coder-common-thin-web
<version>${revision}</version>
</dependency>
```
- **验证方法**: 添加依赖后重新编译和启动应用程序确保所有Controller接口能正常访问
6. **禁止自动编译**: Claude在完成新功能代码或修改代码后严禁自动执行任何编译操作如mvn compile、mvn package等
- **禁止行为**: 严禁在代码修改完成后自动运行编译命令
- **原因说明**: 编译操作应由开发者根据实际需要手动执行,避免不必要的编译开销和潜在的环境冲突
- **允许行为**: 仅在用户明确要求时才执行编译操作
- **验证方法**: 添加依赖后重新编译和启动应用程序确保所有Controller接口能正常访问

View File

@ -152,20 +152,17 @@ public class DashboardServiceImpl implements DashboardService {
);
// 活跃用户数最近30天有登录记录的用户
// 使用原生SQL统计不重复的登录用户数
LambdaQueryWrapper<SysLoginLog> activeWrapper =
new LambdaQueryWrapper<>();
activeWrapper
.apply("login_time >= DATE_SUB(NOW(), INTERVAL 30 DAY)")
.eq(SysLoginLog::getLoginStatus, "0");
// 获取符合条件的登录记录然后统计不重复的用户名
List<SysLoginLog> loginLogs = sysLoginLogMapper.selectList(activeWrapper);
long activeUsers = loginLogs.stream()
.map(SysLoginLog::getLoginName)
.distinct()
.count();
userStats.setActiveUsers((int) activeUsers);
.eq(SysLoginLog::getLoginStatus, "0")
.select(SysLoginLog::getLoginName)
.groupBy(SysLoginLog::getLoginName);
Long activeUsers = sysLoginLogMapper.selectCount(activeWrapper);
userStats.setActiveUsers(
activeUsers != null ? activeUsers.intValue() : 0
);
// 当前在线用户数通过Sa-Token获取
List<String> onlineTokens = StpUtil.searchTokenValue(