- fix missing coroutine in - TypeRepository - TypesController - TypeService - TypesControllerTest - TypeServiceTest - add DevicesEndpoint - add DevicesControllerTest - add devices.http - add DevicesController - add DeviceEntity.toDevicesResponse() to Mapping.kt - add PostgresTestContainer to DeviceService - update DeviceRepository with find all - update version catalog - update container annotation in DeviceEndpoint - update container annotation in IdentityEndpoint - update container annotation in NodeEndpoint - update container annotation in TypeEndpoint - update container annotation in TypesEndpoint - update version in gradle.properties
20 lines
632 B
Kotlin
20 lines
632 B
Kotlin
package ltd.hlaeja.repository
|
|
|
|
import java.util.UUID
|
|
import kotlinx.coroutines.flow.Flow
|
|
import ltd.hlaeja.entity.DeviceEntity
|
|
import org.springframework.data.r2dbc.repository.Query
|
|
import org.springframework.data.repository.kotlin.CoroutineCrudRepository
|
|
import org.springframework.data.repository.query.Param
|
|
import org.springframework.stereotype.Repository
|
|
|
|
@Repository
|
|
interface DeviceRepository : CoroutineCrudRepository<DeviceEntity, UUID> {
|
|
|
|
@Query("SELECT * FROM devices LIMIT :limit OFFSET :offset")
|
|
fun findAll(
|
|
@Param("offset") offset: Int,
|
|
@Param("limit") limit: Int,
|
|
): Flow<DeviceEntity>
|
|
}
|