Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

[#23] 주소 검색 기능 개발 #24

Merged
merged 24 commits into from
Nov 22, 2019
Merged

[#23] 주소 검색 기능 개발 #24

merged 24 commits into from
Nov 22, 2019

Conversation

yyy9942
Copy link
Collaborator

@yyy9942 yyy9942 commented Oct 31, 2019

주소 검색 로직 개발

yyy9942 added 11 commits October 24, 2019 20:54
- ShopUpdateDTO를 추가하여 정보 업데이트시 가져오는 정보를 표시
- 업데이트 매장이 로그인한 사장님 소유인지 확인
- 오픈, 마감 시도시 각각 오픈과 마감이 가능한 상태인지 확인한다.
- 오픈, 마감시 각각 로그를 기록한다.
- 오픈시에는 로그를 insert, 마감시에는 로그를 update한다.
* Work ==> 매장 영업 기록

- ShopUpdateDTO 세팅시 값을 복사하여 전달하도록 변경
- Member
1. address, address_detail 삭제
2. address_code 추가, AddressDTO 추가
3. 정보 조회시 resultMap을 이용하여 조회하도록 변경

- Shop
1. address, address_detail 삭제
2. address_code 추가
=> 추후 AddressDTO와 배달지역을 저장하기 위한 List<AddressDTO>를 추가할 예정
addressCode 말고 상세 주소(xxx호) 정보가 필요하다고 판단하여 해당 컬럼 추가
- AOP 의존성 추가
- AOP 적용 어노테이션 생성
- 중복되는 로그인체크, 매장 주인 체크 로직 삭제
- 어노테이션을 적용하여 로그인체크, 매장 주인체크 진행
@yyy9942 yyy9942 self-assigned this Oct 31, 2019
yyy9942 added 4 commits November 4, 2019 12:23
- Aspect에서 CommonResponse 삭제
- HttpStatusCodeException을 사용하여 throw하도록 변경
1. 주소 조회시 필요한 컬럼만 조회하도록 설정
2. AOP 로그인권한 체크 로직을 Around -> Before로 변경
3. CheckStyle 미적용된 부분에 컨밴션 적용
1. 배달 지역 추가시 유효성 검증
- 배달지역 추가 데이터를 Set으로 받아와서 중복된 추가 값을 하나로 통일
- 이미 추가되어있는 지역을 추가하려고 시도할 때 유니크 키 익셉션이 발생하는 것을 랩핑하여 예외처리 진행

2. 코드 리팩토링
- 위치정보 관련된 기능이 ShopMapper에 존재해서 DeliveryLocationMapper로 이동시킴
- 그 밖에도 메서드 위치가 잘못된 것을 찾아서 이동시킴
- ResponseEntity에 담을 정보가 없는 컨트롤러 메서드의 반환 값을 void로 변경
- 요청 url을 좀 더 직관적으로 변경
- 자잘한 변수 이름 수정 및 컨밴션 적용

3. 주소 로직
- 자신의 배달 가능 지역을 불러오는 기능 추가
- 배달 가능 지역을 추가할 때 한번에 다중 insert를 진행하도록 변경
- DB에 shop_id와 town_code를 유니크 키로 만들어서 중복된 배달지역이 생기지 않도록 변경
- DB에서 유니크키 관력 Exception이 발생하면 그 Exception을 랩핑하도록 추가
- 자신의 매장 정보를 조회할 때 AdressDTO로 배달 주소 조회 -> DeliveryLocationDTO로 배달
주소조회하도록 변경
- 캐싱을 위한 설정및 의존성 추가
- 주소 검색, 배달 가능지역 조회에 시범적으로 캐싱 적용
Copy link
Member

@f-lab-dev f-lab-dev left a comment

Choose a reason for hiding this comment

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

점점 코드가 깔끔해지는게 보이네요. 좋습니다~

@Around("@annotation(com.delfood.aop.OwnerLoginCheck)")
public Object ownerLoginCheck(ProceedingJoinPoint pjp) throws Throwable {
@Before("@annotation(com.delfood.aop.OwnerLoginCheck)")
public void ownerLoginCheck(JoinPoint jp) throws Throwable {
Copy link
Member

Choose a reason for hiding this comment

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

깔끔하군요~

@@ -155,7 +157,8 @@

// 해당 매장이 영업중이 아닐시
if (shopService.notOpenCheck(id) == true) {
return new ResponseEntity<CloseShopResponse>(CloseShopResponse.NOT_OPEN, HttpStatus.BAD_REQUEST);
return new ResponseEntity<CloseShopResponse>(CloseShopResponse.NOT_OPEN,
Copy link
Member

Choose a reason for hiding this comment

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

모든 값이 상수이기때문에 ResponseEntity 객체를 상수화시키는건 어떨까요?

yyy9942 added 4 commits November 14, 2019 10:00
- 필요없는 toString 오버라이드 제거
- CacheKeys 상수 클래스를 제거
- 가독성 향상을 위한 개행
yyy9942 and others added 4 commits November 21, 2019 15:41
- 주소 검색 Request를 도로명, 지번검색으로 나눔
- 캐싱 키를 제작하는 로직 제작
- 캐싱을 서비스 레이어에서 진행하도록 변경

주소 검색 쿼리 수정
- 통합 검색을 도로명, 지번 검색에 따른 쿼리로 나눔
- NULL값이 들어올 경우 공백으로 검색하도록 변경
@yyy9942 yyy9942 changed the base branch from feature/8 to feature/2 November 22, 2019 05:33
@yyy9942 yyy9942 merged commit dbdbe37 into feature/2 Nov 22, 2019
@yyy9942 yyy9942 changed the title #23 Feature/10 [#23] 주소 검색 기능, 매장 오픈및 마감 기능 개발 Dec 24, 2019
@yyy9942 yyy9942 changed the title [#23] 주소 검색 기능, 매장 오픈및 마감 기능 개발 [#23] 주소 검색 기능 개발 Dec 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants