Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#9] 키워드 입력값 파라미터 추가 #10

Merged
merged 6 commits into from
Jan 8, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor: keyword, time을 디스트럭처링 할당 방식으로 변경
  • Loading branch information
myoungji-kim committed Jan 8, 2025
commit 4f8d6580dcc610e1cfd0f4766dc77757f3ecaa75
5 changes: 2 additions & 3 deletions src/main/kotlin/com/easternkite/remain/Routing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ fun Application.configureRouting() {
post("/time") {
runCatching {
val body = call.receive<DrRequestBody>()
val text = body.text.replace("\"", "").split(" ")
val keyword = text[0];
val (keyword, time) = body.text.replace("\"", "").split(" ")

val format = DateTimeFormatter.ofPattern("HH:mm")
val inputTime = LocalTime.parse(text[1], format)
val inputTime = LocalTime.parse(time, format)
val currentTime = LocalTime.now()
val duration = Duration.between(currentTime, inputTime)
val message = MessageUtil.getMessage(keyword, duration)
Expand Down
Loading