fixing command alternatives being required

fixing filename for export emote stats
fixing reaction report message update
This commit is contained in:
Sheldan
2022-08-01 22:59:48 +02:00
parent 0a4238c9f5
commit b747516881
5 changed files with 18 additions and 13 deletions

View File

@@ -7,10 +7,9 @@ import org.springframework.stereotype.Repository;
import java.time.Instant;
import java.util.List;
import java.util.Optional;
@Repository
public interface ReactionReportRepository extends JpaRepository<ReactionReport, Long> {
List<ReactionReport> findByReportedUserAndCreatedLessThan(AUserInAServer aUserInAServer, Instant maxCreated);
List<ReactionReport> findByReportedUserAndCreatedGreaterThan(AUserInAServer aUserInAServer, Instant maxCreated);
}

View File

@@ -31,7 +31,7 @@ public class ReactionReportManagementServiceBean implements ReactionReportManage
@Override
public Optional<ReactionReport> findRecentReactionReportAboutUser(AUserInAServer aUserInAServer, Duration maxAge) {
Instant maxCreation = Instant.now().minus(maxAge);
List<ReactionReport> foundReports = repository.findByReportedUserAndCreatedLessThan(aUserInAServer, maxCreation);
List<ReactionReport> foundReports = repository.findByReportedUserAndCreatedGreaterThan(aUserInAServer, maxCreation);
return foundReports.isEmpty() ? Optional.empty() : Optional.of(foundReports.get(0));
}