feat: add user leveling and experience system

This commit is contained in:
Tim
2025-07-28 12:34:45 +08:00
parent a5900aa60d
commit 1c2751422d
18 changed files with 167 additions and 10 deletions

View File

@@ -27,6 +27,9 @@ public interface ReactionRepository extends JpaRepository<Reaction, Long> {
@Query("SELECT COUNT(r) FROM Reaction r WHERE r.user.username = :username AND r.type = com.openisle.model.ReactionType.LIKE")
long countLikesSent(@Param("username") String username);
@Query("SELECT COUNT(r) FROM Reaction r WHERE r.user.username = :username AND r.createdAt >= :start")
long countByUserAfter(@Param("username") String username, @Param("start") java.time.LocalDateTime start);
@Query("SELECT COUNT(r) FROM Reaction r WHERE r.type = com.openisle.model.ReactionType.LIKE AND ((r.post IS NOT NULL AND r.post.author.username = :username) OR (r.comment IS NOT NULL AND r.comment.author.username = :username))")
long countLikesReceived(@Param("username") String username);
}