-
Notifications
You must be signed in to change notification settings - Fork 82
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
[Team-08][BE][후&아더] - 프로젝트 셋팅, MockService 구현, Swagger 적용, CI/CD 기능 완성 #67
Conversation
1. github action 워크플로우 추가 end
1. build.gradle 종속성 추가 end
1. build.gradle에 jar 파일 설정 2. Dockerfile 추가 3. HelloController 추가 end
1. Address 작성 2. RoomCondition 작성 end Co-Authored-By: WooJin Park(Ader) <29879110+ak2j38@users.noreply.github.com>
[Feat] 공통으로 사용하는 타입 생성
Co-Authored-By: WooJin Park(Ader) <29879110+ak2j38@users.noreply.github.com>
1. 숙소 리스트 API를 위한 RoomRequest, RoomResponse DTO 소스 추가 2. MockApi 제공을 위해 MockRoomService 추가 3. RoomController 추가 end
1. 숙소 상세정보 API를 위한 Image, Images(일급컬렉션) 추가 2. RoomDetailResponse DTO 파일 추가 end
1. Controller, Service 코드에 로그 추가 end
1. Controller 누락된 로그 추가 end
1. 누락된 주소, 호스트정보, 숙소조건 추가 end
1. google java format style 적용 end
1. @slf4j 어노테이션 순서 통일 end
[BE] 숙소 도메인 MockAPI 기능 구현
[Feat] 예약 도메인 MockAPI 구현
1. MockWishService로 임시 데이터 응답처리 2. WishController 구현 end
[Feat] 위시 도메인 MockAPI 구현
1. build.gradle 의존성 추가 2. Swagger 설정 클래스 추가 end
1. RoomController Swagger 적용 2. WishController Swagger 적용 3. HelloController 삭제 end
1. ReservationController Swagger 적용 end
[Feat] Swagger 적용
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.
안녕하세요, 3주 동안 리뷰를 맡은 Sigrid Jin입니다.
앞으로 잘 부탁드립니다~
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration |
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.
nit
@Configuration
과 @Bean
간의 관계를 설명해주실 수 있으신가요?
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.
@Configuration
내부에는 @Component
라는 어노테이션이 포함되어 있습니다.
이를 통해 컴포넌트 스캔이 이루어지며 컴포넌트 스캔 과정에서 @Bean
어노테이션으로 등록한 설정파일들이
스프링 컨테이너를 통해 관리됩니다.
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.
기회가 되시면 @Configuration
내부의 @Component
가 어떻게 @Bean
어노테이션의 IoC 컨테이너에 자동으로 스캔 후 등록하는지 동작 방식에 대해 디버깅 해보시면서 학습하시길 권장드립니다.
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.
넵! 컴포넌트 스캔 과정을 디버깅하면서 학습해보겠습니다 😄
@AllArgsConstructor | ||
public class MemberResponse { | ||
|
||
private 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.
wrapper type
대신 primitive type
을 사용하신 이유가 있으실까요?
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.
MemberResponse
는 응답이므로 항상 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.
글쎄요. primitive type
을 사용했을 때의 장점이 얼마나 있을까요?
비록 Entity가 아니라 일반 DTO라는 사실을 고려해도, 저는 wrapper type
사용을 추천드립니다.
그 이유는, default value가 0으로 잘못 설정되는 경우를 방지하기 위함이며, 오히려 wrapper type을 명시해야 null이 되는 상황에서도 validation 로직에서 오류 상황을 분기해서 대처할 수 있기 때문입니다. 저는 Exception을 통해서 던져주는 것이 DB 상에 잘못된 데이터가 들어가는 것보다 훨씬 안정적인 대처라고 생각하기 때문입니다.
아무리 DTO라고 하더라도 특별한 이유가 없는 이상 현재 시점에서는 통일성을 가져가시길 추천드립니다.
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.
wrapper type
으로 dto 변경 완료했습니다.
추후 validation
로직 추가해서 오류 상황에 대처하도록 하겠습니다. 감사합니다.
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.
단순하게 항상 값이 존재할테니까 원시타입쓰자~! 밀어 붙였는데 장단점 정리해두니 래퍼클래스 사용하는게 훨씬 좋아보이네요ㅎㅎ 의견 감사합니다 시그리두 래퍼클래스로 일괄 변경 완료하였습니다!
BE/src/main/java/com/ahoo/airbnb/reservation/dtos/ReservationResponse.java
Show resolved
Hide resolved
BE/src/main/java/com/ahoo/airbnb/reservation/dtos/ReservationResponse.java
Show resolved
Hide resolved
BE/src/main/java/com/ahoo/airbnb/reservation/dtos/RoomChargeResponse.java
Outdated
Show resolved
Hide resolved
@AllArgsConstructor | ||
public class Image { | ||
|
||
private int sequence; |
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.
sequence
가 뭔가요?
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.
숙소 상세 페이지에 전달되는 DTO(RoomDetailResponse)에는 여러 장의 이미지가 포함되어 있는데 이 이미지들의 순서를 보장하기 위해서 추가한 필드입니다.
지금 생각해보니 List<Image>
를 멤버로 갖고있는 Images
라는 일급컬렉션을 넘긴다면 내부가 List
로 되어있어 순서 보장이 되므로 sequence
가 필요 없을 것도 같은데 이 경우에도 sequence
를 넘기는 것이 맞는 판단일까요?
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.
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.
@who-hoo 님의 의견이 맞습니다. SQL-dialect한 데이터베이스의 경우 순서를 기본적으로 보장하지 않습니다.
If an <order by clause> is not specified, then the ordering of the rows of Q is implementation-dependent.
순서값을 같이 내려주어야 할 것 같습니다. 그게 아니라면, 권장하지는 않지만 경우에 따라 아예 @Entity
취급을 하는 것도 방법일 수 있겠네요.
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.
권장하지는 않지만 경우에 따라 아예 @entity 취급을 하는 것도 방법일 수 있겠네요.
권장하지 않으시는 이유와 @Entity
취급을 한다는 의도가 잘 이해가 되지 않습니다.
혹시 설명 부탁드려도 될까요?? 😂
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.
@ak2j38 Data Object가 Entity는 아니기 때문입니다. 하지만 Data Object 임에도 Entity처럼 고유성을 가지도록 처리해야 할 필요성이 있다면 불가피하게 Entity로 끌어올려 줄 필요가 생길 수 있습니다.
1. primitive type과 wrapper type 통일 2. 파라미터 wrapper type으로 변경 end Co-authored-by: who-hoo <who.ho3ov@gmail.com>
1. Charge 클래스 삭제 2. Charges dto 네이밍 ChargesResponse로 변경 및 패키지 이동 end Co-authored-by: who-hoo <who.ho3ov@gmail.com>
안녕하세요! 코드리뷰 내용 적용했습니다. |
숙소 예약 POST 요청 시 HTTP 응답 바디에 상태코드와 메시지를 출력하기 위한 DTO 추가. 이후 해당 DTO를 반환하도록 컨트롤러와 서비스 계층 로직 수정.
* [Muffin] 검색결과 페이지 - 왼쪽 레이아웃 작업 ( 더미데이터 사용하여 화면 출력) (#67) * feat: Search Component 분리 * refactor: 메인페이지 가까운 레이아웃 스켈레톤 UI 적용해보기 * feat: 검색결과 페이지 왼쪽 레이아웃 더미데이터 사용하여 렌더링 * refactor: location 타입 지정 * refactor: room 컴포넌트 내 함수 네이밍 수정 * [Park] create mock server (#68) * feat: create msw * feat: some data use dummy data * refactor: main page type & varriables name refactoring * feat: useFetch hooks * feat: useFetch type modify * data: roomDetailList -> roomDetail 로 수정 * [Muffin] 검색 결과페이지 숙소 모달 관련 기능 작업, moment 라이브러리 추가 * [Muffin] modal창을 열었을때 Header 밀리는 현상 * [Muffin] 차트 슬라이드 에러 수정 * refactor: slider 에러 관련 처리 및 날짜 미선택 시 차트 모달에 안내 텍스트 보여주기 * refactor: 빅서치바 인풋 체크인, 체크아웃 x 버튼클릭시 에도 차트 관련 데이터 리셋 * refactor: price 금액 초기화 하는 context SET_INIT_PRICE type으로 초기화 하도록 수정 * [Park] GitHub OAuth login * feat: github login authorization and get code * feat: post logic 백엔드에서 처리 -> CORS 문제로 이전 * feat: github login, avatar url * style: 안쓰는 변수 제거 * fix: .env github client id add * refactor: 중복 로직 제거 및 안쓰는 변수 제거 * fix: map scroll & rooms type Co-authored-by: Muffin <jinlog9@gmail.com>
안녕하세요 시그리드 👋
hoo
와Ader
입니다!3주 동안 잘 부탁드립니다~~ 🙇♀️ 🙇♂️
기능 구현 목록
CI/CD
를 위한github action
및aws
설정MockAPI Server
를 위해MockService
작성MockService
를 구현한 이유는Controller
단을 먼저 개발할 수 있고 나중에MockService
를 실제Service
로 변경하면 변경이 최소화되는 장점이 생겨서 시도해보았습니다.Swagger
적용을 통한 API 문서 제공ERD
ERD 링크
비밀번호는
ncvuvt
입니다.고민 사항은 코멘트에 추가했습니다!