Add DAU statistics module

This commit is contained in:
Tim
2025-07-14 21:21:50 +08:00
parent c9c96edcb0
commit f42f277cb3
7 changed files with 110 additions and 1 deletions

View File

@@ -32,4 +32,9 @@ public class UserVisitService {
.orElseThrow(() -> new com.openisle.exception.NotFoundException("User not found"));
return userVisitRepository.countByUser(user);
}
public long countDau(LocalDate date) {
LocalDate d = date != null ? date : LocalDate.now();
return userVisitRepository.countByVisitDate(d);
}
}