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

[BE][Team-17][Robin, Cooper] 반찬가게 1차 PR 요청드립니다. #24

Merged
merged 58 commits into from
Apr 29, 2021

Conversation

pbg0205
Copy link

@pbg0205 pbg0205 commented Apr 23, 2021

안녕하세요. team17의 백엔드 로빈, 쿠퍼입니다.
반찬가게 API 구현 1차 PR 드립니다.😄
아래에 구현 목록 사항과 목업 API 명세서 URL 첨부하여 보내드립니다.
부족한 코드, 시간내어 리뷰해주셔서 감사합니다. 🙇‍♂️ 🙇‍♀️

구현 목록 사항

  • 베스트 카테고리 기준 전체 상품 목록 조회

  • 베스트 카테고리 기준 세부 상품 목록 조회

  • 밥찬들 카테고리 기준 세부 상품 목록 조회

목업 API 명세서 URL

pbg0205 and others added 22 commits April 20, 2021 16:45
- 스프링 부트와 mysql을 연동해라
- 반찬 item, image, best_category, dish_category 테이블을 생성해라
Feat: 스프링 데이터 jdbc으로 셋팅하라
- Item domain을 생성해라
- Image domain을 생성해라
- DishCategory domain을 생성해라
- BestCategory domain을 생성해라
- ItemRepository를 생성해라
- ImageRepository를 생성해라
- DishCategoryRepository를 생성해라
- BestCategoryRepository를 생성해라
- 변경된 image, item 컬럼에 따라 domain 변경
- best_category 및 dish_category 에 대한 insert구문 추가
Fix : DB 스키마 변경하라
- discription -> description으로 변수명을 변경하라.
- 리턴타입을 List로 한 findAll 메서드를 생성하라.
- 베스트 카테고리 전체 목록을 조회하라.

- 베스트 카테고리 세부 목록을 조회하라.
- ItemService를 추가하라.

- ImageService를 추가하라.

- BestCategoryService를 추가하라.
- itemId -> item_id로 변경하라.
style : ItemDto item 변수명을 변경하라.
- DishCategoryController 구현
- DishCategoryService 구현
- DishCategoryDto 구현
Feat: DishCategory 조회 기능을 구현해라
@ksundong ksundong added the review-BE BE 리뷰 label Apr 23, 2021
@wheejuni wheejuni self-assigned this Apr 24, 2021
@wheejuni wheejuni self-requested a review April 24, 2021 11:55
Copy link

@wheejuni wheejuni left a comment

Choose a reason for hiding this comment

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

수고 많으셨습니다. 👍
이번 프로젝트는 스펙 규모가 꽤 되는 거 같네요. 많은 고민 끝에 작성하신 코드 잘 보았습니다.

개선하면 좋을 부분 추려서 피드백 남겨보았는데 확인 부탁드릴게요.

import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/best")

Choose a reason for hiding this comment

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

클라이언트 개발자들과 협의한 거겠지만 그리 좋은 path로 보이진 않습니다.
API인지도 불분명하고, 무엇보다 무엇을 위한 best인지 잘 나타나지 않는 것 같아요.

Comment on lines 16 to 17
private final ItemService itemService;
private final ImageService imageService;

Choose a reason for hiding this comment

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

우선 이 두 서비스는 아직 사용되지 않는 것 같네요.
그리고 하나의 컨트롤러에 세 개의 서비스나 필요하다면, 컨트롤러가 분리돼야 하는 건 아닌지 고민해 보셔야 할 수도 있겟습니다.
이미지와 아이템까지 여기서 처리해야 하나요?

Copy link
Author

Choose a reason for hiding this comment

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

리팩토링 과정에서 삭제하지 못한 의존성 주입입니다ㅠ 변경하도록 하겠습니다!!

Comment on lines 16 to 18
private BigDecimal nPrice;

private BigDecimal sPrice;

Choose a reason for hiding this comment

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

BigDecimal 사용 좋습니다. 👍
그러나 nPrice, sPrice 라는 변수명은 아쉽네요. ns 에 담긴 의미가 잘 유추되지 않습니다.

Copy link
Author

Choose a reason for hiding this comment

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

MockAPI 변수 그대로 사용하는 과정에서 변수명 의미가 불명확하게 선언했네요ㅠ
normalPrice와 salePrice로 변수명 변경하도로 하겠습니다!
피드백 주셔서 감사합니다.😃

Comment on lines 15 to 16
private BigDecimal n_price;
private BigDecimal s_price;

Choose a reason for hiding this comment

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

어떤 경우에도 Java의 코딩 컨벤션에 맞지 않는 변수명을 사용하는 것은 자제해 주시면 좋겠습니다.
만약 JSON response를 위한 커스텀 필드명을 사용하고 싶다면, 아래 링크를 참조해 적절한 애노테이션을 이용하면 됩니다.

https://www.baeldung.com/jackson-annotations

만약 카멜 케이스 변수명에 대해 일괄적으로 스네이크 케이스를 사용하는 것이 목적이라면, 아래 링크를 보고 학습해 보시는 것도 좋겠습니다. (아래 링크에 담긴 첫번째 솔루션은 권장하지 않습니다)

https://stackoverflow.com/questions/10519265/jackson-overcoming-underscores-in-favor-of-camel-case

Copy link
Author

Choose a reason for hiding this comment

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

위에 참고해주신 내용을 바탕으로 한번 수정해보도록 하겠습니다!

Comment on lines 17 to 18
private final ItemService itemService;
private final ImageService imageService;

Choose a reason for hiding this comment

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

서비스에서 타 서비스에 의존하는 방식은 가급적이면 피해 주시고,
지금 객체 그래프 탐색이 되지않다보니 이 두 엔티티를 조회하는 것이 불가피한 측면이 있어보이는데요,
ItemRepositoryImageRepository 를 바로 주입받는 방향이 더 좋아 보입니다.

- 사용하지 않는 ItemService 제거

- 사용하지 않는 ImageService 제거
- 사용하지 않는 ImageService를 제거하라.
- 현재 단계에서 imageService의 큰 사용이 없어 조회기능을
imageRepository로 주입해서 조회하도록 변경하라.
- Java Naming Convention에 맞게 camel case로 변경하여라.

- 정확한 의미를 부여할 수 있도록 변수명을 구체적으로 작성하라.
pbg0205 and others added 19 commits April 27, 2021 16:20
- 중복된 URL을 제거하라.

- recommanded -> recommended로 변경하라.
fix : 오탈자 수정 및 URL 추가 수정
style : 중복된 URL을 제거하라.
- 이벤트 특가, 론칭 특가 순서 변경
refactor : RequestBody 형태로 데이터를 전달받아라.
@pbg0205 pbg0205 requested a review from wheejuni April 28, 2021 08:52
@pbg0205
Copy link
Author

pbg0205 commented Apr 28, 2021

리뷰해주신 부분에 대해서 수정 완료하였습니다!
급하게 프로젝트 진행하는 과정에서 리뷰 사항 외에 추가 기능 구현 내용이 반영되었습니다ㅠ
이 점 유의하셔서 확인 부탁드립니다.
다시 한번 시간내서 리뷰해주신 점 감사드립니다. 😄

malaheaven and others added 4 commits April 28, 2021 20:16
- best 카테고리
- dish 카테고리
- 이미지
- 아이템
- 재고부족
Feat: 커스텀 이셉션 핸들러를 이용하여 예외를 처리
feat : CORS 설정에 PUT METHOD를 추가하라.
ghis22130 pushed a commit that referenced this pull request Apr 29, 2021
@wheejuni wheejuni merged commit e345de0 into codesquad-members-2021:team17 Apr 29, 2021
crongro pushed a commit that referenced this pull request May 3, 2021
* [#1] feat : create CRA

 - CRA를 설치했습니다

* [#1] feat : mediumCard index.jsx prop 추가

 - 상동

* [#1] feat : node-sass 추가

 - node sass를 추가했습니다

* [#1] feat : 폴더 구조 정리

 - atoms, molecules, images 등 파일 구조 수정했습니다

* [#5] feat : reset scss 추가

- reset scss 추가
- 기본 글꼴 추가

* [#5] feat : button, icon, tag components 추가

 - atoms의 button, icon, tag component를 재사용 가능한 형태로 생성했습니다.

* [#5] feat: set moculses structure

- LargeCard 구조설정
- MediumCard 구조 설정

* [#5] chore : 잘못 생성된 파일 수정

 - 파일 명을 sidedish -> frontend로 바꾸는 과정에서 폴더 구성이 꼬여서 수정

* [#5] feat: molcules- LargeCard,MediumCard 구조 생성

* [#13] feat : MainDish, More 컴포넌트 생성

 - 신규 컴포넌트 생성: maindish, more organisms

* [#11] feat: fetch를 위한 util dir 생성

- util/loadData 생성 : fetch로 data가져오기
- util/url 생성: 기본 url주소 변수 설정

* [#11] feat: HeaderLeft 생성

* [#13] feat : MediumCard TagType 추가

 - 메인요리에 medium카드를 사용하기 위해 medium카드 일부 속성을 수정했습니다.

* [#13] feat : useFetch 컴포넌트 추가

 - fetch기능을 분리하기 위해 util-useFetch컴포넌트를 생성

* [#11] feat: Header 생성

- HeaderLeft 구조 생성
- HeaderRight 구조 생성
- BestDish 구조 생성 중

* [#11] feat: useFatch fetch오류 해결

* [#12] feat: BestDish useTabs hook 사용

* [#13] feat : 카드 캐로셀 기능 완성

 - setTimeout으로 렌더링을 지연시켜 캐로셀 기능을 완성

* [#12] feat: BestDish UI 및 기능구성

- Tab 버튼 클릭시 rendering
- Header Style 일부 수정 (HeaderRight,HeaderLeft,Span,Icon)

* deploy : build 210423

* [#13] feat: CSS style 수정

- innerTitle 설정

* chore: add gitginore

* chore: Add basic gradlew files

* [#13] feat: MainDish,SideDish,BestDish CSS style디테일 설정

- mainDish의 <Icon>,<Image> margin 설정

* [#13] fix : tag 버튼 오류, carousel 렌더링 지연 방식 변경

 - tag 가 이벤트 특가만 나타나는 오류 수정
 - carousel 렌더링 지연 방식을 setTimeOut ->  onTransitionEnd 로 변경

* deploy : build 210424

* [#25] feat : Detail UI 컴포넌트 생성

 - Detail UI 를 위한 InfoGeneral, InfoImages, InfoNumber, InfoPrice, InfoProduct molecules 컴포넌트 생성

* [#24] feat: ADD tab click event(color change)

- Fix MediumCard Tag 부분

* [#25] fix : icon onClick 이벤트 실행 로직 수정

 - icon이 left, right 일 경우에만 moveSlide이벤트가 실행되도록 수정

* [#24] feat: ADD Img MouseOver event

- useState를 통한 isHover로 상태변경 가능

* [#24] feat: Fix CSS Detail in HoverEvent

* deploy : build 210427

* [#24] feat: ADD HeaderDrop event

- Header MouseOver 시 Drop event 추가
- Header DropMenu MouseOver 시 hover event 추가
- Private Component 이름 통일변경 (ex Div -> WrapDiv)
- Component들의 inex.style.jsx 추가 (Styled div 분리)

* [#25] fix : MainDish Carousel 스타일 적용 함수 분리

 - MainDish 스타일 및 매직넘버 삭제

* [#37] refactor : 코드리뷰 반영

 - useFatch 구조 변경 : loadData 컴포넌트 생성해서 데이터만 받아오고 useEffect는 각 컴포넌트에서 실행
 - tag 내용 및 컨텐츠 적용 방식 수정
 - span 스타일 컴포넌트 적용방식을 className 사용으로 변경

* [#25] feat : Detail UI 컴포넌트 수정

 - pages 컴포넌트 생성

* [#25] feat : Modal 컴포넌트 생성

- 모달 컴포넌트 생성 및 클릭 후 모달 오픈, close 버튼 클릭시 숨김 기능 구현

* [#25] feat: Modal data fetch 연결

* deploy : build 210428

* deploy : rebuild 210428

* deploy : rebuild 210428

* deploy : rebuild 210428

* build : rebuild 210428

* [#26] feat : 상세페이지 내 이미지 이벤트 추가

 - 이미지 및 썸네일 추가
 - 썸네일 클릭 시 메인 이미지 변경 이벤트 추가

* [#26] feat : large 카드에 모달 이벤트 추가

- large 카드에도 모달 이벤트를 추가했으나, 아직 베스트 반찬에는 데이터 api를 못받아오고 있으므로 실행은 되지 않게끔 주석처리 했습니다

* [#27] feat: Detail - Info UI 생성 및 fetch data 연결

* deploy :build 210429

* [#27] feat: Fix syntax error

* build : build 210429

* [#26] refactor : carousel 컴포넌트 생성

- 라이브러리화를 위해 carousel 컴포넌트 생성

* build : rebuild 210429

* build : rebuild 210429

* [#26] refactor : carousel 컴포넌트 완성

carousel, carousel style 컴포넌트를 mainDish 컴포넌트에서 분리 완료

* [#26] feat : OtherCard, DetailOther 컴포넌트 생성

 - 디테일 Carousel 작업을 위해 상기 컴포넌트 생성

* [#27] feat: Datail CSS UI 수정

- UI: BestMenu 오른쪽마진 수정
- UI: HoverCard 가운데 정렬  수정
- UI: Mouse cursor 디테일 설정
- feat: useTabs 삭제 및 component내부로 수정
- faet: getComma 파일생성 ( 원, (,) 넣는 함수)

* deploy : rebuild 210429

* deploy : build 210430

* [#27] FE API data fetch 연결 확인

* [#45] FE API data fetch 연결 확인

* [#26] feat : OtherCard 스타일 적용 완성

 - Other Card의 레이아웃 완성

* [#26] feat : OtherCard 케로셀 적용 중

* [#45] feat: 디테일한 CSS UI 구성

* [#26] feat : OtherCard 케로셀 완료

- portal을 적용해서 기존 캐러셀 컴포넌트를 재활용할 수 없는 관계로 캐로셀을 중복해서 사용함

* [#45] feat: fetch Data API and 합치기

* [#45]feat: Details 파일명 변경 및 데이터 전달

* [#45] feat:Details close error 해결

* [#45]feat: CSS style 수정

* [#45] feat: Image data 수정

* fix : Change directory name to camel case

Co-authored-by: ink-0 <71919983+ink-0@users.noreply.github.com>
Co-authored-by: woody <woojihye2339@gmail.com>
Co-authored-by: Tree <gmldbs1109@naver.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-44-162.ap-northeast-2.compute.internal>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-BE BE 리뷰
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants