Skip to content

Conversation

@doup2001
Copy link
Contributor

@doup2001 doup2001 commented May 28, 2025

✨ feat : Payment service 추가

Summary by CodeRabbit

  • 신규 기능

    • 결제 서비스(Spring Boot 기반) 신규 도입: 결제 생성, 결제 취소, 결제 내역 조회 API 제공
    • 외부 결제(PG) 연동(Toss Payments), 주문 서비스 연동(주문 완료/취소)
    • Swagger(OpenAPI) 기반 API 문서 자동화 및 정적 랜딩 페이지 추가
    • 결제 상태 관리(PAID, PENDING, REFUNDED) 및 표준화된 응답 구조 제공
  • 버그 수정

    • 해당 없음
  • 문서화

    • README 및 Swagger 예제, API 명세 추가
  • 테스트

    • 기본 애플리케이션 구동 테스트 추가
  • 환경설정/배포

    • Gradle 빌드/실행 환경 및 CI/CD 환경변수 개선
    • .gitignore, .gitattributes 등 프로젝트 관리 파일 추가

doup2001 and others added 24 commits May 16, 2025 15:36
- 날짜형 변환
…/주문-연동

✨feat : Payment service/feature/주문 연동
…/swagger

♻️ refactor: Payment service/feature/swagger
♻️ refactor : 결제 서버 미구현 부분 수정
…/swagger

♻️ refactor : OrderFeignPort 수정
♻️ refactor : 결제 서비스 주소 변경
@coderabbitai
Copy link

coderabbitai bot commented May 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

이번 변경은 payment-service 모듈의 전체 구조를 도입하는 것으로, 도메인, 애플리케이션, 어댑터 계층, 외부 결제 연동, 주문 서비스 연동, API 컨트롤러, DTO, 공통 응답 및 예외 처리, Swagger 설정, Gradle 빌드 환경, CI/CD 워크플로우, 정적 리소스, 테스트 코드 등을 포함합니다.

Changes

파일/경로 그룹 변경 요약
.github/workflows/ci-cd-payment-service.yml EC2_SSH_USER 환경변수를 시크릿 참조로 변경, PROJECT_PATH 경로 수정
payment-service/.gitattributes, .gitignore, README.md, build.gradle, gradle/wrapper/, gradlew, settings.gradle Gradle 빌드/실행 환경 및 Git 속성, 무시 파일, README, 프로젝트 설정 추가
payment-service/src/main/java/gcu/web/paymentservice/PaymentServiceApplication.java Spring Boot 메인 애플리케이션 클래스 및 Feign 클라이언트 활성화 추가
payment-service/src/main/java/gcu/web/paymentservice/common/config/* Swagger(OpenAPI) 및 CORS 설정 클래스 추가
payment-service/src/main/java/gcu/web/paymentservice/common/response/* 공통 API 응답, 예외, 에러코드, 페이지네이션 관련 클래스/레코드 추가
payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/in/web/* 결제 API 컨트롤러, Swagger 명세 인터페이스, 요청/응답 DTO 추가
payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/out/* 결제 JPA 엔티티/리포지토리, 외부 주문 서비스 Feign, Toss PG 연동 어댑터 추가
payment-service/src/main/java/gcu/web/paymentservice/platform/application/in/PaymentUseCase.java 결제 유스케이스 인터페이스 추가
payment-service/src/main/java/gcu/web/paymentservice/platform/application/out/* 결제 영속성, 외부 PG 연동 포트 인터페이스 추가
payment-service/src/main/java/gcu/web/paymentservice/platform/application/service/PaymentService.java 결제 서비스 구현체(PG, 주문 서비스 연동 포함) 추가
payment-service/src/main/java/gcu/web/paymentservice/platform/domain/* 결제 도메인 및 상태 Enum 추가
payment-service/src/main/resources/static/index.html 한글 안내 및 Swagger 링크 포함 정적 랜딩 페이지 추가
payment-service/src/test/java/gcu/web/paymentservice/PaymentServiceApplicationTests.java Spring Boot 컨텍스트 로딩 테스트 추가

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant PaymentApi
    participant PaymentService
    participant TossPaymentAdapter
    participant PaymentPersistenceAdapter
    participant OrderFeignPort

    Client->>PaymentApi: POST /api/v1/payments/confirm (ConfirmPaymentRequest)
    PaymentApi->>PaymentService: savePayment(request)
    PaymentService->>TossPaymentAdapter: requestConfirm(request)
    TossPaymentAdapter-->>PaymentService: Toss 결제 승인 응답
    PaymentService->>PaymentPersistenceAdapter: savePayment(Payment)
    PaymentPersistenceAdapter-->>PaymentService: 저장된 Payment
    PaymentService->>OrderFeignPort: completeOrder(orderId)
    OrderFeignPort-->>PaymentService: 주문 완료 응답
    PaymentService-->>PaymentApi: Payment 반환
    PaymentApi-->>Client: ApiResponse<PaymentResponse>
Loading
sequenceDiagram
    participant Client
    participant PaymentApi
    participant PaymentService
    participant PaymentPersistenceAdapter
    participant TossPaymentAdapter
    participant OrderFeignPort

    Client->>PaymentApi: DELETE /api/v1/payments/refund (CancelPaymentRequest)
    PaymentApi->>PaymentService: deletePayment(request)
    PaymentService->>PaymentPersistenceAdapter: loadPaymentByPaymentKey(paymentKey)
    PaymentPersistenceAdapter-->>PaymentService: Payment 조회
    PaymentService->>TossPaymentAdapter: requestPaymentCancel(paymentKey, reason)
    TossPaymentAdapter-->>PaymentService: Toss 결제 취소 응답
    PaymentService->>PaymentPersistenceAdapter: deletePayment(paymentId)
    PaymentPersistenceAdapter-->>PaymentService: 삭제 완료
    PaymentService->>OrderFeignPort: cancelOrder(orderId)
    OrderFeignPort-->>PaymentService: 주문 취소 응답
    PaymentService-->>PaymentApi: 취소 완료 메시지
    PaymentApi-->>Client: ApiResponse<String>
Loading

Possibly related PRs

Suggested labels

enhancement

Poem

(\(\
( -.-)
o_(")(")

결제 토끼가 춤을 춘다,
새 서비스가 출발한다!
Toss와 주문, 모두 연결,
Swagger 문서도 번쩍 빛나네.
고급 웹 결제, 이제 출발~
토끼도 기뻐 깡총깡총! 🐇💳✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6303a6e and cba7980.

⛔ Files ignored due to path filters (1)
  • payment-service/gradle/wrapper/gradle-wrapper.jar is excluded by !**/*.jar
📒 Files selected for processing (36)
  • .github/workflows/ci-cd-payment-service.yml (1 hunks)
  • payment-service/.gitattributes (1 hunks)
  • payment-service/.gitignore (1 hunks)
  • payment-service/README.md (1 hunks)
  • payment-service/build.gradle (1 hunks)
  • payment-service/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • payment-service/gradlew (1 hunks)
  • payment-service/gradlew.bat (1 hunks)
  • payment-service/settings.gradle (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/PaymentServiceApplication.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/config/SwaggerConfig.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/config/WebMvcConfig.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/response/ApiResponse.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/response/CustomException.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/response/ErrorCode.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/response/ExceptionDto.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/response/pageable/PageRequest.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/common/response/pageable/PageResponse.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/in/web/PaymentApi.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/in/web/dto/request/CancelPaymentRequest.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/in/web/dto/request/ConfirmPaymentRequest.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/in/web/dto/response/PaymentResponse.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/in/web/swagger/PaymentApiSpec.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/out/PaymentPersistenceAdapter.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/out/external/order/OrderFeignPort.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/out/jpa/payment/PaymentJpaEntity.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/out/jpa/payment/PaymentJpaRepository.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/adapter/out/pg/toss/TossPaymentAdapter.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/application/in/PaymentUseCase.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/application/out/PaymentPort.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/application/out/pg/PaymentExternalPort.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/application/service/PaymentService.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/domain/Payment.java (1 hunks)
  • payment-service/src/main/java/gcu/web/paymentservice/platform/domain/PaymentStatus.java (1 hunks)
  • payment-service/src/main/resources/static/index.html (1 hunks)
  • payment-service/src/test/java/gcu/web/paymentservice/PaymentServiceApplicationTests.java (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@doup2001 doup2001 merged commit 0751dcc into gateway-service/feature/setting May 28, 2025
2 of 3 checks passed
@doup2001 doup2001 temporarily deployed to payment-service May 29, 2025 06:31 — with GitHub Actions Inactive
@doup2001 doup2001 temporarily deployed to payment-service May 29, 2025 06:32 — with GitHub Actions Inactive
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.

3 participants