diff --git a/src/main/java/com/snackgame/server/game/snackgame/controller/SnackgameController.kt b/src/main/java/com/snackgame/server/game/snackgame/controller/SnackgameController.kt index ce0dfa4..3bd0e4f 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/controller/SnackgameController.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/controller/SnackgameController.kt @@ -44,21 +44,25 @@ class SnackgameController( 현재는 점수 수정만 가능하며, 기존 점수가 덮어쓰기된다.""" ) - @PutMapping("/{sessionId}/score") + @PutMapping("/{sessionId}") fun update( @Authenticated member: Member, @PathVariable sessionId: Long, - @RequestBody request: @Valid SnackgameUpdateRequest, + @RequestBody @Valid request: SnackgameUpdateRequest, ): SnackgameResponse = snackgameService.update(member.id, sessionId, request) @Operation( + summary = "스낵게임 세션 수 삽입", + description = """ + 지정한 세션에 수들을 삽입한다. 황금사과를 제거한 경우 초기화된 판을 응답한다. + """ ) - @PutMapping("/{sessionId}") + @PutMapping("/{sessionId}/moves") fun placeMoves( @Authenticated member: Member, @PathVariable sessionId: Long, - @RequestBody requests: @Valid List + @RequestBody @Valid requests: List ): ResponseEntity = snackgameService.placeMoves(member.id, sessionId, requests) .map { game -> ResponseEntity diff --git a/src/main/java/com/snackgame/server/game/snackgame/domain/Board.kt b/src/main/java/com/snackgame/server/game/snackgame/domain/Board.kt index 9387259..6721ac0 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/domain/Board.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/domain/Board.kt @@ -80,4 +80,4 @@ class Board() { companion object { private const val REMOVABLE_SUM = 10; } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/domain/BoardConverter.kt b/src/main/java/com/snackgame/server/game/snackgame/domain/BoardConverter.kt index 35490a6..79dc42b 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/domain/BoardConverter.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/domain/BoardConverter.kt @@ -32,4 +32,4 @@ class BoardConverter : AttributeConverter { throw RuntimeException(e) } } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/domain/Coordinate.kt b/src/main/java/com/snackgame/server/game/snackgame/domain/Coordinate.kt index c269696..b0e9a64 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/domain/Coordinate.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/domain/Coordinate.kt @@ -39,4 +39,4 @@ class Coordinate(val y: Int, val x: Int) { ", x=" + x + '}' } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/domain/SnacksFactory.kt b/src/main/java/com/snackgame/server/game/snackgame/domain/SnacksFactory.kt index 954214b..4f30829 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/domain/SnacksFactory.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/domain/SnacksFactory.kt @@ -44,4 +44,4 @@ private fun pickIndexIn(size: Int): Int { private fun allPositive(vararg numbers: Int): Boolean { return numbers.all { it > 0 } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/domain/Streak.kt b/src/main/java/com/snackgame/server/game/snackgame/domain/Streak.kt index 6154448..a197484 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/domain/Streak.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/domain/Streak.kt @@ -23,4 +23,4 @@ class Streak(private val coordinates: MutableList) { } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/EmptySnackException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/EmptySnackException.kt index 1182730..2f28224 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/EmptySnackException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/EmptySnackException.kt @@ -3,4 +3,4 @@ package com.snackgame.server.game.snackgame.exception import com.snackgame.server.common.exception.Kind class EmptySnackException(message: String, kind: Kind = Kind.BAD_REQUEST) : SnackgameException(message, kind) { -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/InaccuratePercentileException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/InaccuratePercentileException.kt index afcbcb5..5398d83 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/InaccuratePercentileException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/InaccuratePercentileException.kt @@ -4,4 +4,4 @@ import com.snackgame.server.common.exception.Kind class InaccuratePercentileException(percentile: Double) : SnackgameException( "백분위 계산이 잘못되었습니다: $percentile", Kind.INTERNAL_SERVER_ERROR -) \ No newline at end of file +) diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidBoardSizeException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidBoardSizeException.kt index dfe5334..ea12b3d 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidBoardSizeException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidBoardSizeException.kt @@ -1,4 +1,4 @@ package com.snackgame.server.game.snackgame.exception class InvalidBoardSizeException : SnackgameException("잘못된 크기의 게임판입니다.") { -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidCoordinateException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidCoordinateException.kt index 61d2640..975049e 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidCoordinateException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/InvalidCoordinateException.kt @@ -2,4 +2,4 @@ package com.snackgame.server.game.snackgame.exception class InvalidCoordinateException : SnackgameException("잘못된 좌표입니다.") { -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/NegativeCoordinateException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/NegativeCoordinateException.kt index 6c00a54..212ebad 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/NegativeCoordinateException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/NegativeCoordinateException.kt @@ -1,4 +1,4 @@ package com.snackgame.server.game.snackgame.exception class NegativeCoordinateException : SnackgameException("좌표는 음수가 아니어야 합니다.") { -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNotRemovableException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNotRemovableException.kt index ef7d065..d4a50eb 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNotRemovableException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNotRemovableException.kt @@ -3,4 +3,4 @@ package com.snackgame.server.game.snackgame.exception import com.snackgame.server.common.exception.Kind class SnackNotRemovableException(message: String, kind: Kind = Kind.BAD_REQUEST) : SnackgameException(message, kind) { -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNumberRangeException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNumberRangeException.kt index 571e2e0..dd63941 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNumberRangeException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/SnackNumberRangeException.kt @@ -1,4 +1,4 @@ package com.snackgame.server.game.snackgame.exception class SnackNumberRangeException : SnackgameException("잘못된 범위의 숫자입니다.") { -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/exception/SnackgameException.kt b/src/main/java/com/snackgame/server/game/snackgame/exception/SnackgameException.kt index 06b5463..456c2d3 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/exception/SnackgameException.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/exception/SnackgameException.kt @@ -4,3 +4,4 @@ import com.snackgame.server.common.exception.BusinessException import com.snackgame.server.common.exception.Kind abstract class SnackgameException(message: String, kind: Kind = Kind.BAD_REQUEST) : BusinessException(kind, message) + diff --git a/src/main/java/com/snackgame/server/game/snackgame/service/dto/StreakRequest.kt b/src/main/java/com/snackgame/server/game/snackgame/service/dto/StreakRequest.kt index a9c010f..c5164d2 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/service/dto/StreakRequest.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/service/dto/StreakRequest.kt @@ -13,4 +13,4 @@ data class StreakRequest( return Streak(coordinates) } } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/snack/EmptySnack.kt b/src/main/java/com/snackgame/server/game/snackgame/snack/EmptySnack.kt index 4020f74..f1685ff 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/snack/EmptySnack.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/snack/EmptySnack.kt @@ -23,4 +23,4 @@ class EmptySnack private constructor() : Snack() { override fun exists(): Boolean { return false } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/snack/GoldenSnack.kt b/src/main/java/com/snackgame/server/game/snackgame/snack/GoldenSnack.kt index 304d084..ed4cc04 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/snack/GoldenSnack.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/snack/GoldenSnack.kt @@ -24,4 +24,4 @@ class GoldenSnack private constructor(number: Int) : Snack(number) { override fun exists(): Boolean { return true } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/snack/PlainSnack.kt b/src/main/java/com/snackgame/server/game/snackgame/snack/PlainSnack.kt index 27c6275..0981b5c 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/snack/PlainSnack.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/snack/PlainSnack.kt @@ -29,4 +29,4 @@ class PlainSnack private constructor(number: Int) : Snack(number) { override fun exists(): Boolean { return true } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/snack/Snack.kt b/src/main/java/com/snackgame/server/game/snackgame/snack/Snack.kt index 9c35736..0d15873 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/snack/Snack.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/snack/Snack.kt @@ -37,4 +37,4 @@ abstract class Snack protected constructor( } -} \ No newline at end of file +} diff --git a/src/main/java/com/snackgame/server/game/snackgame/snack/SnackDeserializer.kt b/src/main/java/com/snackgame/server/game/snackgame/snack/SnackDeserializer.kt index 09f717f..6249f7e 100644 --- a/src/main/java/com/snackgame/server/game/snackgame/snack/SnackDeserializer.kt +++ b/src/main/java/com/snackgame/server/game/snackgame/snack/SnackDeserializer.kt @@ -24,4 +24,4 @@ class SnackDeserializer : StdDeserializer(Snack.javaClass) { else -> PlainSnack.of(number) } } -} \ No newline at end of file +} diff --git a/src/test/java/com/snackgame/server/game/snackgame/domain/BoardTest.kt b/src/test/java/com/snackgame/server/game/snackgame/domain/BoardTest.kt index f3eb3d9..a8a580c 100644 --- a/src/test/java/com/snackgame/server/game/snackgame/domain/BoardTest.kt +++ b/src/test/java/com/snackgame/server/game/snackgame/domain/BoardTest.kt @@ -39,4 +39,4 @@ class BoardTest { board.removeSnacksIn(streak) } } -} \ No newline at end of file +} diff --git a/src/test/java/com/snackgame/server/game/snackgame/domain/SnackgameTest.kt b/src/test/java/com/snackgame/server/game/snackgame/domain/SnackgameTest.kt index fa450f6..ac608c9 100644 --- a/src/test/java/com/snackgame/server/game/snackgame/domain/SnackgameTest.kt +++ b/src/test/java/com/snackgame/server/game/snackgame/domain/SnackgameTest.kt @@ -43,4 +43,4 @@ class SnackgameTest { game.removeSnacks(streak) assertThat(game.score).isEqualTo(expectedScore) } -} \ No newline at end of file +} diff --git a/src/test/java/com/snackgame/server/game/snackgame/domain/StreakTest.kt b/src/test/java/com/snackgame/server/game/snackgame/domain/StreakTest.kt index d34c28f..6d7ff18 100644 --- a/src/test/java/com/snackgame/server/game/snackgame/domain/StreakTest.kt +++ b/src/test/java/com/snackgame/server/game/snackgame/domain/StreakTest.kt @@ -27,7 +27,6 @@ class StreakTest { Coordinate(2, 1), ) ) - println(properStreak.toCoordinates().size) assertDoesNotThrow { properStreak.validateStreak() } } -} \ No newline at end of file +}