Add chess resign and undo actions
All checks were successful
Deploy Blog Backend / test (push) Successful in 1m20s
Deploy Blog Backend / deploy (push) Successful in 1m27s

This commit is contained in:
박원엽
2026-06-19 16:41:03 +09:00
parent bd08af5d59
commit 5686d3d5ad
3 changed files with 230 additions and 0 deletions

View File

@@ -79,4 +79,20 @@ class ChessGameController(
): ResponseEntity<ApiResponse<ChessGameResponse>> {
return ResponseEntity.ok(ApiResponse.success(chessGameService.playMove(userDetails.memberId, gameId, request)))
}
@PostMapping("/{gameId}/resign")
fun resign(
@AuthenticationPrincipal userDetails: CustomUserDetails,
@PathVariable gameId: String
): ResponseEntity<ApiResponse<ChessGameResponse>> {
return ResponseEntity.ok(ApiResponse.success(chessGameService.resign(userDetails.memberId, gameId)))
}
@PostMapping("/{gameId}/undo")
fun undoMove(
@AuthenticationPrincipal userDetails: CustomUserDetails,
@PathVariable gameId: String
): ResponseEntity<ApiResponse<ChessGameResponse>> {
return ResponseEntity.ok(ApiResponse.success(chessGameService.undoMove(userDetails.memberId, gameId)))
}
}