Skip to content

[FEATURE/#75] 자산 동기화 상태 확인 API 구현 #76

Open
seamooll wants to merge 6 commits intomainfrom
feat/#75-sync-status
Open

[FEATURE/#75] 자산 동기화 상태 확인 API 구현 #76
seamooll wants to merge 6 commits intomainfrom
feat/#75-sync-status

Conversation

@seamooll
Copy link
Contributor

@seamooll seamooll commented Feb 4, 2026

🔗 Related Issue

📝 Summary

  • 자산 동기화 비동기 로그 시스템 도입
    • 비동기로 수행되는 자산 동기화 작업의 상태를 기록할 수 있도록 SyncLog 도메인 추가
    • AssetSyncProcessor@Async 로직에서 실제 비동기 실행 결과가 로그에 반영되도록 처리
  • 동기화 API 도메인 정리
    • 동기화 실행 API를 Asset -> Connection 도메인으로 이동
  • 동기화 상태 조회 API 추가
    • 비동기 작업의 진행 상태를 프론프엔드에서 확인할 수 있도록 상태 조회 API 구현
    • 현재 상태(IN_PROGRESS / SUCCESS / FAILED), 마지막 동기화 시간, 에러 메시지 반환

🔄 Changes

  • API 변경 (추가/수정)
  • 데이터 및 도메인 변경 (DB, 비즈니스 로직)
  • 설정 또는 인프라 관련 변경
  • 리팩토링

💬 Questions & Review Points

📸 API Test Results (Swagger)

image image

✅ Checklist

  • API 테스트 완료
  • 테스트 결과 사진 첨부
  • 빌드 성공 확인 (./gradlew build)

@seamooll seamooll self-assigned this Feb 4, 2026
@seamooll seamooll added ✨ feat 기능 구현 ♻️ refactor 코드 구조 개선 labels Feb 4, 2026
@seamooll seamooll linked an issue Feb 4, 2026 that may be closed by this pull request
1 task
@seamooll seamooll added the 도희 도희 label Feb 4, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello @seamooll, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 풀 리퀘스트는 자산 동기화 작업의 투명성을 높이고 사용자 경험을 개선하기 위해 비동기 동기화 상태 추적 시스템을 도입합니다. 동기화 요청을 백그라운드에서 처리하고, 그 진행 상황과 결과를 실시간으로 조회할 수 있는 새로운 API를 제공하여, 사용자가 동기화 완료 여부를 명확히 알 수 있도록 합니다. 또한, 관련 API의 도메인 재정리를 통해 시스템의 일관성을 강화했습니다.

Highlights

  • 자산 동기화 비동기 로그 시스템 도입: 비동기로 수행되는 자산 동기화 작업의 상태를 기록하기 위한 SyncLog 도메인(엔티티, DTO, 레포지토리, 컨버터, 서비스 포함)이 추가되었습니다. AssetSyncProcessor의 비동기 로직에서 실제 실행 결과가 이 로그에 반영되도록 처리됩니다.
  • 동기화 API 도메인 이동 및 신규 API 추가: 기존 AssetController에 있던 자산 동기화 실행 API(refreshAssetSync)가 ConnectionController로 이동되었습니다. 또한, 비동기 작업의 진행 상태를 프론트엔드에서 확인할 수 있도록 ConnectionController에 동기화 상태 조회 API(getSyncStatus)가 새로 추가되었습니다. 이 API는 현재 상태(IN_PROGRESS / SUCCESS / FAILED), 마지막 동기화 시간, 에러 메시지를 반환합니다.
  • 패키지 구조 리팩토링: Connection 도메인 내 서비스 계층이 commandquery 서브 패키지로 분리되어 역할에 따른 책임이 명확해졌습니다.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • src/main/java/org/umc/valuedi/domain/asset/controller/AssetController.java
    • AssetSyncFacadeService 의존성 및 refreshAssetSync POST 엔드포인트 제거
  • src/main/java/org/umc/valuedi/domain/asset/controller/AssetControllerDocs.java
    • refreshAssetSync API 관련 Swagger 문서 제거
  • src/main/java/org/umc/valuedi/domain/asset/exception/code/AssetSuccessCode.java
    • SYNC_REQUEST_SUCCESS 성공 코드 제거
  • src/main/java/org/umc/valuedi/domain/asset/service/command/AssetSyncFacadeService.java
    • SyncLogCommandService 의존성 추가
    • refreshAssetSync 메서드에서 동기화 시작 시 SyncLog를 생성하고, 생성된 logIdAssetSyncProcessor로 전달하도록 수정
  • src/main/java/org/umc/valuedi/domain/asset/service/command/AssetSyncProcessor.java
    • SyncLogCommandService 의존성 추가
    • runSyncProcess 메서드가 logId를 인자로 받도록 변경
    • 동기화 성공 시 syncLogCommandService.updateToSuccess(logId) 호출
    • 동기화 실패 시 syncLogCommandService.updateToFailed(logId, errorMessage) 호출하여 에러 기록
  • src/main/java/org/umc/valuedi/domain/connection/controller/ConnectionController.java
    • AssetSyncFacadeServiceSyncLogQueryService 의존성 추가
    • 자산 동기화 요청을 위한 refreshAssetSync POST 엔드포인트 추가 (기존 AssetController에서 이동)
    • 동기화 상태 조회를 위한 getSyncStatus GET 엔드포인트 추가
  • src/main/java/org/umc/valuedi/domain/connection/controller/ConnectionControllerDocs.java
    • 자산 동기화 요청 API (refreshAssetSync) 및 동기화 상태 조회 API (getSyncStatus)에 대한 Swagger 문서 추가
  • src/main/java/org/umc/valuedi/domain/connection/converter/SyncLogConverter.java
    • SyncLog 엔티티를 SyncLogResponseDTO로 변환하는 toSyncLogResponseDTO 메서드 추가
    • MemberSyncType을 받아 초기 IN_PROGRESS 상태의 SyncLog 엔티티로 변환하는 toEntity 메서드 추가
  • src/main/java/org/umc/valuedi/domain/connection/dto/req/SyncLogReqDTO.java
    • 비어있는 SyncLogReqDTO 클래스 추가
  • src/main/java/org/umc/valuedi/domain/connection/dto/res/SyncLogResDTO.java
    • 동기화 로그 응답을 위한 SyncLogResponseDTO 내부 클래스 추가 (syncLogId, syncStatus, syncType, errorMessage, updatedAt 포함)
  • src/main/java/org/umc/valuedi/domain/connection/entity/SyncLog.java
    • 동기화 로그를 저장하기 위한 SyncLog 엔티티 추가 (id, syncStatus, syncType, errorMessage, member 필드 포함)
    • 상태를 SUCCESS로 변경하는 markAsSuccess() 메서드 추가
    • 상태를 FAILED로 변경하고 에러 메시지를 기록하는 markAsFailed(String errorDetail) 메서드 추가
  • src/main/java/org/umc/valuedi/domain/connection/enums/SyncStatus.java
    • 동기화 상태를 정의하는 SyncStatus 열거형 추가 (PENDING, IN_PROGRESS, SUCCESS, FAILED)
  • src/main/java/org/umc/valuedi/domain/connection/enums/SyncType.java
    • 동기화 유형을 정의하는 SyncType 열거형 추가 (ALL, BANK, CARD)
  • src/main/java/org/umc/valuedi/domain/connection/exception/code/ConnectionErrorCode.java
    • SYNC_LOG_NOT_FOUND 에러 코드 추가
  • src/main/java/org/umc/valuedi/domain/connection/exception/code/ConnectionSuccessCode.java
    • SYNC_STATUS_FETCH_SUCCESSSYNC_REQUEST_SUCCESS 성공 코드 추가
    • CONNECTION_SUCCESS의 HTTP 상태 코드를 OK에서 ACCEPTED로 변경
  • src/main/java/org/umc/valuedi/domain/connection/repository/SyncLogRepository.java
    • SyncLog 엔티티를 위한 SyncLogRepository 인터페이스 추가
    • 가장 최근 동기화 로그를 조회하는 findFirstByMemberIdOrderByCreatedAtDesc 메서드 정의
  • src/main/java/org/umc/valuedi/domain/connection/service/command/ConnectionCommandService.java
    • 패키지 경로가 org.umc.valuedi.domain.connection.service에서 org.umc.valuedi.domain.connection.service.command로 변경
  • src/main/java/org/umc/valuedi/domain/connection/service/command/SyncLogCommandService.java
    • SyncLog의 생성 및 상태 업데이트를 담당하는 SyncLogCommandService 추가
    • startSyncLog, updateToSuccess, updateToFailed 메서드 구현
  • src/main/java/org/umc/valuedi/domain/connection/service/event/ConnectionEventListener.java
    • 패키지 경로가 org.umc.valuedi.domain.connection.service에서 org.umc.valuedi.domain.connection.service.event로 변경
  • src/main/java/org/umc/valuedi/domain/connection/service/query/ConnectionQueryService.java
    • 패키지 경로가 org.umc.valuedi.domain.connection.service에서 org.umc.valuedi.domain.connection.service.query로 변경
    • 사용되지 않는 CodefCardServiceCollections import 제거
  • src/main/java/org/umc/valuedi/domain/connection/service/query/SyncLogQueryService.java
    • 회원의 동기화 상태를 조회하는 SyncLogQueryService 추가
    • 회원이 현재 동기화 중인지 확인하는 isMemberSyncing 메서드 구현
    • 가장 최근 동기화 로그 상세 정보를 조회하는 getLatestSyncLog 메서드 구현
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

안녕하세요. 자산 동기화 상태 확인 API 구현에 대한 PR 잘 보았습니다. 비동기 작업의 상태를 추적하기 위해 SyncLog 도메인을 도입하고, 관련 API를 connection 도메인으로 재구성하는 등 전체적인 구조 개선이 인상적입니다. 코드의 안정성과 명확성을 높이기 위한 몇 가지 개선 사항을 제안드립니다.

Copy link
Collaborator

@kkeunii kkeunii left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ feat 기능 구현 ♻️ refactor 코드 구조 개선 도희 도희

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] 동기화 상태 확인 API 구현

2 participants