서버 조회 수정
This commit is contained in:
@@ -7,6 +7,7 @@ import com.eactive.testmaster.server.mapper.ServerMapper;
|
|||||||
import com.eactive.testmaster.server.service.ServerMgmtService;
|
import com.eactive.testmaster.server.service.ServerMgmtService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
@@ -33,8 +34,10 @@ public class ServerRestController {
|
|||||||
|
|
||||||
@GetMapping("/list.do")
|
@GetMapping("/list.do")
|
||||||
@Secured("ROLE_API_TESTER")
|
@Secured("ROLE_API_TESTER")
|
||||||
public ResponseEntity<List<ServerDTO>> listView(@ModelAttribute("serverSearch") ServerSearch serverSearch, ModelMap model, Pageable pageable) {
|
public ResponseEntity<List<ServerDTO>> listView(@ModelAttribute("serverSearch") ServerSearch serverSearch) {
|
||||||
Page<Server> page = serverMgmtService.findAll(serverSearch.buildSpecification(), pageable);
|
Pageable maxPageable = PageRequest.of(0, Integer.MAX_VALUE);
|
||||||
|
|
||||||
|
Page<Server> page = serverMgmtService.findAll(serverSearch.buildSpecification(), maxPageable);
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.add("X-Total-Count", String.valueOf(page.getTotalElements()));
|
headers.add("X-Total-Count", String.valueOf(page.getTotalElements()));
|
||||||
headers.add("X-Total-Pages", String.valueOf(page.getTotalPages()));
|
headers.add("X-Total-Pages", String.valueOf(page.getTotalPages()));
|
||||||
|
|||||||
Reference in New Issue
Block a user