Skip to content

Commit

Permalink
Feat: 스테이지 초기화 기능 컨트롤러 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
suhyun113 committed Nov 27, 2024
1 parent 56c6de7 commit 74f59e5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class StageController {

@Autowired
private StageService stageService;
@Autowired
private StageResetService stageResetService;

// 특정 스테이지 접근 가능 여부 확인
@GetMapping("/{stageId}/access")
Expand Down Expand Up @@ -55,15 +53,6 @@ public StageProgressResponseDto getStageStatus(
@PathVariable int stageId,
@RequestParam String sessionId
) {

return stageService.getStageStatus(sessionId, stageId);
}

// POST /stage/{stageId}/retry
@PostMapping("/{stageId}/reset")
public ResponseEntity<StageResetResponseDto> resetStage(
@PathVariable int stageId,
@RequestParam String sessionId) {
return ResponseEntity.ok(stageResetService.resetStage(sessionId, stageId));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.example.rememberdokdo.Controller;

import com.example.rememberdokdo.Dto.StageResetResponseDto;
import com.example.rememberdokdo.Service.StageResetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/stage")
public class StageResetController {
@Autowired
private StageResetService stageResetService;

// POST /stage/reset
@PostMapping("/reset")
public ResponseEntity<StageResetResponseDto> resetStage(
@RequestParam String sessionId) {
return ResponseEntity.ok(stageResetService.resetStage(sessionId));
}
}

0 comments on commit 74f59e5

Please sign in to comment.