File tree Expand file tree Collapse file tree
apps/commerce-api/src/main/java/com/loopers/interfaces/api/ranking Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import com .loopers .application .ranking .RankingInfo .RankingPageInfo ;
55import com .loopers .interfaces .api .ApiResponse ;
66import com .loopers .interfaces .api .ranking .RankingV1Dto .RankingPageResponse ;
7+ import jakarta .validation .constraints .Max ;
8+ import jakarta .validation .constraints .Min ;
79import lombok .RequiredArgsConstructor ;
10+ import org .springframework .validation .annotation .Validated ;
811import org .springframework .web .bind .annotation .*;
912
13+ @ Validated
1014@ RequiredArgsConstructor
1115@ RestController
1216@ RequestMapping ("/api/v1" )
@@ -23,8 +27,8 @@ public class RankingV1Controller {
2327 @ GetMapping ("/rankings" )
2428 public ApiResponse <RankingPageResponse > getRankings (
2529 @ RequestParam (value = "date" , required = false ) String date ,
26- @ RequestParam (value = "page" , defaultValue = "1" ) int page ,
27- @ RequestParam (value = "size" , defaultValue = "20" ) int size
30+ @ RequestParam (value = "page" , defaultValue = "1" ) @ Min ( 1 ) int page ,
31+ @ RequestParam (value = "size" , defaultValue = "20" ) @ Min ( 1 ) @ Max ( 100 ) int size
2832 ) {
2933 // API는 1-based, 내부는 0-based로 변환
3034 int zeroBasedPage = Math .max (0 , page - 1 );
You can’t perform that action at this time.
0 commit comments