test #359

Merged
klaus merged 15 commits from test into main 2025-11-13 19:45:53 +00:00
Showing only changes of commit e4c1cf5a9a - Show all commits

View File

@@ -8,7 +8,9 @@ import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param
import org.springframework.stereotype.Repository
import java.time.LocalDateTime
@Repository
interface CharacterImageRepository : JpaRepository<CharacterImage, Long>, CharacterImageQueryRepository {
@@ -26,6 +28,21 @@ interface CharacterImageRepository : JpaRepository<CharacterImage, Long>, Charac
"WHERE ci.chatCharacter.id = :characterId AND ci.isActive = true"
)
fun findMaxSortOrderByCharacterId(characterId: Long): Int
@Query(
"""
select distinct c.id
from CharacterImage ci
join ci.chatCharacter c
where ci.isActive = true
and ci.createdAt >= :since
and c.id in :characterIds
"""
)
fun findCharacterIdsWithRecentImages(
@Param("characterIds") characterIds: List<Long>,
@Param("since") since: LocalDateTime
): List<Long>
}
interface CharacterImageQueryRepository {