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

[feat] 멱등성키 적용을 통한 중복 결제 문제 해결 #153

Closed
wants to merge 33 commits into from

Commits on Aug 22, 2024

  1. [feat] redis를 이용하여 cart를 저장/조회/삭제하도록 구현 (#134)

    * [feat] Redis 환경설정 파일 생성
    
    - port 와 host를 받아 connection을 생성
    - redisTemplate에 직렬화 도구로 key : string, value = GenericJackson2JsonRedisSerializer 로 설정
    
    * [fix] Cart의 생성자를 protected에서 public으로 변경
    
    * [fix] CaartService에서 customerId의 cart를 가져오는 로직을 supplier로 변경
    
    * [feat] Redis전용 CartEntity와 CartItemEntity를 생성
    
    * [feat] Redis를 이용해서 Cart를 영속하는 레포지토리 구현
    
    * [test] Redis를 이용해서 Cart를 영속하는 레포지토리 테스트
    
    * [fix] ContainerSettingTest 삭제
    
    여러개의 test-container를 구동시키면 포트 충돌로 일단 삭제
    
    * [fix] testcode 가 돌아갈 수 있도록 환경변수 추가, inmemory cart repository를 primary로 수정
    Hyeon-Uk authored Aug 22, 2024
    Configuration menu
    Copy the full SHA
    c2cf4d6 View commit details
    Browse the repository at this point in the history
  2. [feat] Cart를 DB에 저장한다 (#133)

    * [fix] 카트 도메인 엔티티 수정
    
    * [feat] 카트 영속성 엔티티 구현
    
    * [feat] DB를 사용하는 CartRepository 구현체
    
    * [fix] CartService 오류 수정
    
    Transactional 적용
    orElse -> orElseGet : 데이터가 존재함에도 불구하고 저장되는 오류 수정
    
    * [fix] 도메인 엔티티로 변환시 id값도 추가
    
    * [refactor] 변수명 변경
    
    * [fix] 생성자 접근제어자 protected
    
    * [test] JpaCartRepository 테스트 코드 작성
    Dr-KoKo authored Aug 22, 2024
    Configuration menu
    Copy the full SHA
    8d43c2f View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2024

  1. [feat] 구매자는 카트를 조회할 수 있다 (#137)

    * [feat] 조회하고자 하는 카트가 없을 때 발생시킬 예외 구현
    
    * [feat] 구매자의 카트를 조회하는 Dao
    
    * [feat] 카트 조회 앤드포인트
    
    * [feat] 카트를 조회할 수 있는 Dao를 Redis를 이용해서 구현 (#135)
    
    * [test] menu 더미를 저장하고 반환하는 메서드 추가 및 상점을 24시간 열려있도록 수정
    
    * [feat] getter 및 생성자 추가
    
    * [feat] redis용 dao를 임시로 inMemoryCartRepository를 이용해서 구현
    
    * [test] RedisCartDao 테스트코드 추가
    
    * [feat] CartItemInfo에도 getter 추가
    
    * [fix] 테스트 이후 데이터를 롤백시키기 위해 @transactional 추가
    
    * [fix] CartResponse의 amount를 Integer로 수정
    
    * [feat] Jpa를 이용한 카트 조회 dao
    
    ---------
    
    Co-authored-by: 김현욱 <[email protected]>
    Dr-KoKo and Hyeon-Uk authored Aug 23, 2024
    Configuration menu
    Copy the full SHA
    0c1986e View commit details
    Browse the repository at this point in the history
  2. [feat] CartEntity의 CustomerId 변경

    String -> UUID
    Dr-KoKo committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    d9c9816 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    32ecb91 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bc161c8 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f393d9c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    24d8ccc View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    833fa6c View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e534e18 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    14edb4c View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2024

  1. [fix] OneToMany 관계에서 cascade를 사용하기 위해 mappedBy 사용

    @joincolumn만 이용하면 CartEntity를 통해CartItemEntity를 영속화시키지 못한다.
    Dr-KoKo committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    8d70ebf View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2024

  1. Configuration menu
    Copy the full SHA
    04bb3a0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    898034c View commit details
    Browse the repository at this point in the history
  3. [test] 마이크로미터 앤드포인트 노출

    테스트용 yml 수정
    Dr-KoKo committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    a308456 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9d998a5 View commit details
    Browse the repository at this point in the history
  5. [fix] JpaCartDao 오류 수정

    fetchOne()의 결과로 리스트가 반환되어 오류가 발생
    Dr-KoKo committed Aug 25, 2024
    Configuration menu
    Copy the full SHA
    93e994d View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

  1. [feat] 주문 시점에 배타락을 적용해서 문제를 해결 (#148)

    * [feat] 카트 조회시 X-lock 적용
    
    * [test] TransactionTemplate를 통해서 Cart를 조회
    Dr-KoKo authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    a2b0da5 View commit details
    Browse the repository at this point in the history
  2. [feat] 주문 시점에 분산락을 적용해서 문제를 해결한 버전 (#147)

    * [feat] cartRepository의 findByCustomerId에 분산락을 적용한 버전 임시
    
    * [feat] 분산락을 잡지 못했을 경우에 던지는 exception을 커스텀해서 던질 수 있도록 수정.
    
    * [fix] wait time 을 0초로 변경
    
    - 중복 결제 요청들이 락을 다시 획득하기 위해서 기다릴 필요가 없음
    
    ---------
    
    Co-authored-by: donghar <[email protected]>
    Hyeon-Uk and Dr-KoKo authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    ddf9c3b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fa6980e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    21f03ce View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1cbb09a View commit details
    Browse the repository at this point in the history

Commits on Aug 27, 2024

  1. Configuration menu
    Copy the full SHA
    7247757 View commit details
    Browse the repository at this point in the history
  2. [feat] conflict 해결

    - 기존 테스트환경에서 redis connection 오류를 수정한 main 브랜치를 머지하며 생긴 conflict 해결
    Hyeon-Uk committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    ef4694a View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. Configuration menu
    Copy the full SHA
    be96bc4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    54fd89b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8c73dfb View commit details
    Browse the repository at this point in the history
  4. [feat] 멱등성키를 컨트롤러에 적용

    Co-authored-by: Dr-KoKo <[email protected]>
    Hyeon-Uk and Dr-KoKo committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    dc9f51e View commit details
    Browse the repository at this point in the history
  5. [test] 멱등성키에 대한 테스트코드 작성

    Co-authored-by: Dr-KoKo <[email protected]>
    Hyeon-Uk and Dr-KoKo committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    ff29834 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    123f606 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    075f2a3 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    6155a5e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    eccaccc View commit details
    Browse the repository at this point in the history