Skip to content

Commit

Permalink
Merge pull request #198 from UMC-CARDIFY/hotfix/197/studySuggestionCo…
Browse files Browse the repository at this point in the history
…deError

[FIX] #197 : 분석 학습 제안 GET -> POST 방식으로 수정
  • Loading branch information
dhchoi98 authored Aug 22, 2024
2 parents ec24b04 + a41fb19 commit f386394
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/umc/cardify/controller/CardController.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ public ResponseEntity<?> viewStudyLog(@PathVariable Long studyCardSetId, @Reques
return ResponseEntity.ok(studyLogs);
}

@GetMapping("/study-suggestion")
@PostMapping("/study-suggestion")
@Operation(summary = "분석 학습 제안")
public ResponseEntity<List<CardResponse.getStudySuggestion>> suggestionAnalyzeStudy(@RequestHeader String token,
@RequestParam("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) @Parameter(description = "학습을 위한 날짜와 시간", example = "2024-08-20T12:14:56.597Z") String dateString) {
@RequestBody CardRequest.getSuggestion request) {
Long userId = jwtUtil.extractUserId(token);

Timestamp date = Timestamp.valueOf(LocalDateTime.parse(dateString, DateTimeFormatter.ISO_DATE_TIME));
Timestamp date = Timestamp.valueOf(LocalDateTime.parse(request.getDate(), DateTimeFormatter.ISO_DATE_TIME));

List<CardResponse.getStudySuggestion> suggestions = cardComponentService.suggestionAnalyzeStudy(userId, date);

Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/umc/cardify/dto/card/CardRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,12 @@ public static class difficulty {

}

@Getter
@Schema(title = "CARD_REQ_04 : 분석 학습 제안 DTO")
public static class getSuggestion{
@NotBlank(message = "날짜, 시간 정보 전달 필요")
@Schema(description = "제안 분석에 사용되는 날짜 및 시간. ISO 8601 형식으로 제공됩니다.", example = "2024-08-22T14:30:00")
private String date;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public List<CardResponse.getStudyCardSetLists> getStudyCardSetLists(Long userId,

return studyCardSets.stream()
.map(studyCardSet -> CardResponse.getStudyCardSetLists.builder()
.studyStatus(studyCardSet.getStudyStatus().getDescription())
.studyStatus(studyCardSet.getStudyStatus().getValue())
.noteName(studyCardSet.getNoteName())
.color(studyCardSet.getColor())
.folderName(studyCardSet.getFolder().getName())
Expand Down

0 comments on commit f386394

Please sign in to comment.