Skip to content

Conversation

jxxxxxn
Copy link

@jxxxxxn jxxxxxn commented Oct 4, 2025

1단계 - 홈 화면
2단계 - 예약 조회

(실수로 단계별 commit을 나누지 못했는데, 다음주차부터는 나누어 진행하겠습니다! 번거로이 해드려서 죄송합니다.)

@jxxxxxn jxxxxxn changed the title [Spring MVC] 김남우 미션제출합니다 [Spring MVC] 민지인 미션제출합니다 Oct 4, 2025
Copy link

@juanxiu juanxiu left a 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";
Copy link

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을 찾아서 렌더링할 거예요.

Copy link

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(){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponseEntity 를 사용하셨군요! 좋아요. 하지만 우리 학습 키워드 중 하나가 @ResponseBody 인 만큼 이것을 사용해보는 건 어떨까요?

@jxxxxxn
Copy link
Author

jxxxxxn commented Oct 4, 2025

미션 하느라 고생하셨습니다~~ 리뷰 반영해서 수정 후 푸시해주세요!

수정 후 푸시 완료했습니다! 감사합니다.

import java.time.LocalTime;

public class Reservation {
public Long id;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

제가 놓쳤네요! 필드의 접근 지정자를 무엇으로 설정해야 할까요? public vs private 에 대해 공부해보면 좋을 것 같습니다.

@jxxxxxn
Copy link
Author

jxxxxxn commented Oct 7, 2025

dto 멤버변수 접근지정자 수정 후 푸시했습니다. 캡슐화를 위해 멤버변수를 private으로 설정했습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants