-
Notifications
You must be signed in to change notification settings - Fork 164
[Spring MVC] 민지인 미션제출합니다 #503
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미션 하느라 고생하셨습니다~~ 리뷰 반영해서 수정 후 푸시해주세요!
|
||
@GetMapping("/reservation") | ||
public String reservation(){ | ||
return "/reservation.html"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뷰 이름만 사용하셔도 됩니다! return "reservation"
하셔도 자동으로 templates/reservation.html을 찾아서 렌더링할 거예요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그리고 지금 Model 에 데이터가 없어요. 리스트를 담아서 전달해야 합니다~
} | ||
|
||
@GetMapping("/reservations") | ||
public ResponseEntity<List<Reservation>> reservations(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ResponseEntity
를 사용하셨군요! 좋아요. 하지만 우리 학습 키워드 중 하나가 @ResponseBody
인 만큼 이것을 사용해보는 건 어떨까요?
수정 후 푸시 완료했습니다! 감사합니다. |
import java.time.LocalTime; | ||
|
||
public class Reservation { | ||
public Long id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 놓쳤네요! 필드의 접근 지정자를 무엇으로 설정해야 할까요? public vs private 에 대해 공부해보면 좋을 것 같습니다.
dto 멤버변수 접근지정자 수정 후 푸시했습니다. 캡슐화를 위해 멤버변수를 private으로 설정했습니다! |
1단계 - 홈 화면
2단계 - 예약 조회
(실수로 단계별 commit을 나누지 못했는데, 다음주차부터는 나누어 진행하겠습니다! 번거로이 해드려서 죄송합니다.)