Skip to content

Commit

Permalink
오타수정
Browse files Browse the repository at this point in the history
  • Loading branch information
orieasy1 committed Nov 23, 2024
1 parent b09e0df commit a0bc268
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public ResponseEntity<ApiResponse<ProblemResponse>> getProblem(
public ResponseEntity<ApiResponse<PracticeSubmitResponse>> submitPractice(
@Parameter(description = "Store ID", example = "1") @PathVariable Long storeId,
@RequestBody PracticeSubmitRequest request) {
System.out.println("request = " + request.getQuestionId());
System.out.println("request = " + request.getProblemId());

PracticeSubmitResponse response = practiceService.submitPractice(storeId, request);
return ResponseEntity.ok(ApiResponse.success(response));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class PracticeSubmitRequest {
@NotNull
@Schema(description = "문제 ID", example = "1")
@JsonProperty("question_id")
private Long questionId;
private Long problemId;

@Schema(description = "답변 리스트")
private List<Answer> answers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
public class PracticeSubmitResponse {

@Schema(description = "문제 ID", example = "1")
private Long questionId;
private Long problemId;

@Schema(description = "메뉴 결과", example = "true")
private Boolean menuResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@RequiredArgsConstructor
Expand All @@ -32,7 +31,7 @@ public ProblemResponse getProblemByStoreId(Long storeId) {
}

public PracticeSubmitResponse submitPractice(Long storeId, PracticeSubmitRequest request) {
Solution solution = solutionRepository.findById(request.getQuestionId())
Solution solution = solutionRepository.findById(request.getProblemId())
.orElseThrow(() -> new SolutionException((SolutionErrorCode.SOLUTION_NOT_FOUND)));

List<PracticeSubmitRequest.Answer.Menu> submittedMenus = request.getAnswers().get(0).getMenus();
Expand All @@ -45,7 +44,7 @@ public PracticeSubmitResponse submitPractice(Long storeId, PracticeSubmitRequest

// 결과 반환
return new PracticeSubmitResponse(
request.getQuestionId(),
request.getProblemId(),
menuResult,
optionResult,
amountResult
Expand Down

0 comments on commit a0bc268

Please sign in to comment.