|
@@ -2,13 +2,17 @@ package cn.efunbox.audio.impl;
|
|
|
|
|
|
import cn.efunbox.audio.entity.Admin;
|
|
import cn.efunbox.audio.entity.Admin;
|
|
import cn.efunbox.audio.entity.Channel;
|
|
import cn.efunbox.audio.entity.Channel;
|
|
|
|
+import cn.efunbox.audio.entity.Device;
|
|
import cn.efunbox.audio.repository.AdminRepo;
|
|
import cn.efunbox.audio.repository.AdminRepo;
|
|
import cn.efunbox.audio.repository.ChannelRepo;
|
|
import cn.efunbox.audio.repository.ChannelRepo;
|
|
import cn.efunbox.audio.service.AdminService;
|
|
import cn.efunbox.audio.service.AdminService;
|
|
import cn.efunbox.audio.service.ChannelService;
|
|
import cn.efunbox.audio.service.ChannelService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -27,8 +31,13 @@ public class AdminServiceImpl implements AdminService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<Admin> SearchAll(){
|
|
|
|
- List<Admin> list = adminRepo.findAll();
|
|
|
|
|
|
+ public List<Admin> SearchAll(int page, int size){
|
|
|
|
+ List<Admin> list = new ArrayList<>();
|
|
|
|
+ if(size > 1){
|
|
|
|
+ Pageable pageable = new PageRequest(page, size);
|
|
|
|
+ list = adminRepo.findAll(pageable).getContent();
|
|
|
|
+ }else
|
|
|
|
+ list = adminRepo.findAll();
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|