Skip to content

Commit

Permalink
Merge pull request #109 from mummhy0811/main
Browse files Browse the repository at this point in the history
서버 시간 체크용 컨트롤러
  • Loading branch information
mummhy0811 authored Nov 28, 2023
2 parents 43c6433 + 93a8b09 commit 5b40a00
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.time.LocalTime;
import java.util.Date;
import java.util.List;

@RestController
Expand Down Expand Up @@ -54,4 +56,17 @@ public List<QuizAnswerCheckDTO> checkAnswer(@PathVariable Long quiz_id){
//오늘의 퀴즈 확인
@GetMapping(value = "/quiz/todayQuiz/{family_id}")
public QuizListDTO todayQuiz(@PathVariable String family_id){return quizService.todayQuiz(family_id);}

@GetMapping(value="check")
public String check(){
Date date1 = new Date();
Date date = new Date();
LocalTime now = LocalTime.now();

if(now.getHour()<6){
Date dDate = new Date();
date = new Date(dDate.getTime()+(1000*60*60*24*-1));
}
return date1.toString() + " "+ date;
}
}

0 comments on commit 5b40a00

Please sign in to comment.