Skip to content

Commit d5d31b3

Browse files
authored
Merge pull request #150 from team-gogo/fix/ranking-system-exception-handling
[stage] rank 페이징 예외 처리
2 parents 86dadb8 + cd46ed0 commit d5d31b3

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/main/kotlin/gogo/gogostage/domain/community/root/application/CommunityValidator.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class CommunityValidator {
99

1010
fun validPageAndSize(page: Int, size: Int) {
1111
if (page < 0 || size < 0) {
12-
throw StageException("page와 size는 음수일 수 없습니다.", HttpStatus.BAD_REQUEST.value())
12+
throw StageException("page 혹은 size는 음수일 수 없습니다.", HttpStatus.BAD_REQUEST.value())
1313
}
1414
}
1515

src/main/kotlin/gogo/gogostage/domain/stage/root/application/StageServiceImpl.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class StageServiceImpl(
9595
val student = userUtil.getCurrentStudent()
9696
val stage = stageReader.read(stageId)
9797
stageValidator.validStage(student, stage.id)
98+
stageValidator.validPageAndSize(page, size)
9899
return stageReader.readPointRank(stage, page, size)
99100
}
100101

src/main/kotlin/gogo/gogostage/domain/stage/root/application/StageValidator.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ class StageValidator(
9292
}
9393
}
9494

95+
fun validPageAndSize(page: Int, size: Int) {
96+
if (page < 0 || size < 0) {
97+
throw StageException("page 혹은 size는 음수일 수 없습니다.", HttpStatus.BAD_REQUEST.value())
98+
}
99+
}
100+
95101
private fun validShop(dto: CreateOfficialStageDto) {
96102
if (dto.shop.coinToss.isActive && (dto.shop.coinToss.price == null || dto.shop.coinToss.quantity == null)) {
97103
throw StageException("CoinToss 미니게임의 티켓 가격, 수량을 입력하세요.", HttpStatus.BAD_REQUEST.value())

0 commit comments

Comments
 (0)