|
@@ -13,13 +13,13 @@ import cn.com.qmth.examcloud.app.repository.DeviceRecordRepository;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
/**
|
|
|
* 设备访问记录Service
|
|
|
*/
|
|
@@ -29,10 +29,11 @@ public class DeviceRecordService {
|
|
|
@Autowired
|
|
|
private DeviceRecordRepository deviceRecordRepository;
|
|
|
|
|
|
- public Result<List<DeviceRecord>> getDeviceRecordList(DeviceRecord params) {
|
|
|
+ public Result<Page<DeviceRecord>> getDeviceRecordList(DeviceRecord params) {
|
|
|
Specification<DeviceRecord> spec = null;
|
|
|
- List<DeviceRecord> list = deviceRecordRepository.findAll(spec);
|
|
|
- return new Result<>().success(list);
|
|
|
+ Pageable pageable = null;
|
|
|
+ Page<DeviceRecord> page = deviceRecordRepository.findAll(spec, pageable);
|
|
|
+ return new Result<>().success(page);
|
|
|
}
|
|
|
|
|
|
@Async
|