diff --git a/src/main/java/com/loafle/overflow/module/sensor/dao/SensorItemDAO.java b/src/main/java/com/loafle/overflow/module/sensor/dao/SensorItemDAO.java index dcd4df4..2f3f29d 100644 --- a/src/main/java/com/loafle/overflow/module/sensor/dao/SensorItemDAO.java +++ b/src/main/java/com/loafle/overflow/module/sensor/dao/SensorItemDAO.java @@ -2,16 +2,15 @@ package com.loafle.overflow.module.sensor.dao; import com.loafle.overflow.module.sensor.model.Sensor; import com.loafle.overflow.module.sensor.model.SensorItem; +import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; -import java.util.List; - /** * Created by root on 17. 6. 9. */ @Repository public interface SensorItemDAO extends JpaRepository { - List findAllBySensor(Sensor sensor, Pageable pageable); + Page findAllBySensor(Sensor sensor, Pageable pageable); } diff --git a/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java b/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java index c0eb4ac..07a46bc 100644 --- a/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java +++ b/src/main/java/com/loafle/overflow/module/sensor/service/SensorItemService.java @@ -6,6 +6,7 @@ import com.loafle.overflow.module.sensor.dao.SensorItemDAO; import com.loafle.overflow.module.sensor.model.Sensor; import com.loafle.overflow.module.sensor.model.SensorItem; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; import org.springframework.stereotype.Service; import java.util.List; @@ -31,7 +32,7 @@ public class SensorItemService { return this.sensorItemDAO.findOne(Long.valueOf(id)); } - public List readAllBySensor(Sensor sensor, PageParams pageParams) { + public Page readAllBySensor(Sensor sensor, PageParams pageParams) { return this.sensorItemDAO.findAllBySensor(sensor, PageUtil.getPageRequest(pageParams)); }