File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
back/src/main/java/com/back/global/config Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .back .global .config ;
2+
3+ import org .springframework .context .annotation .Bean ;
4+ import org .springframework .context .annotation .Configuration ;
5+ import org .springframework .data .domain .PageRequest ;
6+ import org .springframework .data .web .config .PageableHandlerMethodArgumentResolverCustomizer ;
7+
8+ /**
9+ * 웹 관련 설정을 정의하는 구성 클래스.
10+ */
11+ @ Configuration
12+ public class WebConfig {
13+
14+ // 스프링의 페이지 요청을 1부터 시작하도록 설정
15+ // 최대 페이지 크기 및 기본 페이지 설정
16+ @ Bean
17+ public PageableHandlerMethodArgumentResolverCustomizer customizer () {
18+ return pageableResolver -> {
19+ pageableResolver .setOneIndexedParameters (true ); // page 요청이 1로 오면 0으로 인식
20+ pageableResolver .setMaxPageSize (50 );
21+ pageableResolver .setFallbackPageable (PageRequest .of (0 , 5 ));
22+ };
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments