improvement: Device External ID (UUID) 도입 (#275) #276

Merged
seonkyu.kim merged 1 commits from improvement/#275-external-device-id into develop 2026-03-03 03:57:52 +00:00
Owner

📋 작업 요약

  • Device.ExternalDeviceId (UUID string) 컬럼 추가
  • 기존 내부 long Id는 DB 관계에서만 사용, 외부 API는 UUID만 노출
  • ITokenCacheService 캐시 키를 ExternalDeviceId 기준으로 변경
  • Device 관련 DTO 10개 DeviceId long → string 변경
  • DeviceRegisterRequestDto에 device_id (UUID, Required) 필드 추가
  • DeviceService / PushService / PushWorker ExternalDeviceId 기반 로직 적용
  • EF Core Migration AddExternalDeviceId 추가

Closes #275

🛠️ 작업 내용 (Changes)

  • SPMS.Domain/Entities/Device.cs — ExternalDeviceId 프로퍼티 추가
  • SPMS.Infrastructure/Persistence/Configurations/DeviceConfiguration.cs — VARCHAR(36), UNIQUE INDEX 추가
  • SPMS.Domain/Interfaces/IDeviceRepository.cs — GetByExternalIdAndServiceAsync 추가
  • SPMS.Infrastructure/Persistence/Repositories/DeviceRepository.cs — 구현
  • SPMS.Application/Interfaces/ITokenCacheService.cs — long → string
  • SPMS.Infrastructure/Caching/TokenCacheService.cs — 구현 동기화
  • Device DTO 10개 — DeviceId long → string
  • SPMS.Application/Services/DeviceService.cs — ExternalDeviceId 기준 로직
  • SPMS.Application/Services/PushService.cs — UUID string 배열 직렬화
  • SPMS.Infrastructure/Workers/PushWorker.cs — ExternalDeviceId 기준 파싱
  • SPMS.Infrastructure/Workers/DeadTokenCleanupWorker.cs — 캐시 무효화 수정
  • SPMS.Infrastructure/Persistence/Repositories/PushSendLogRepository.cs — Device Include 추가
  • Migration/AddExternalDeviceId — 컬럼 + UNIQUE INDEX

📢 리뷰어 참고 사항 (To Reviewers)

  • Device.Id(bigint, PK)는 유지, ExternalDeviceId만 외부 노출
  • 기존 DB 레코드에 ExternalDeviceId가 비어있으면 다음 등록 요청 시 채워짐
  • 캐시 키가 변경되었으므로 배포 후 기존 캐시는 자동 만료됨

체크리스트 (Self Checklist)

  • 빌드(Build)가 성공적으로 수행되었는가?
  • 모든 단위 테스트(Unit Test)를 통과하였는가?
  • 불필요한 로그나 주석을 제거하였는가?
  • 컨벤션(Clean Architecture, Naming)을 준수하였는가?
  • 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가?

📸 스크린샷 / 테스트 로그 (Screenshots/Logs)

## 📋 작업 요약 - Device.ExternalDeviceId (UUID string) 컬럼 추가 - 기존 내부 long Id는 DB 관계에서만 사용, 외부 API는 UUID만 노출 - ITokenCacheService 캐시 키를 ExternalDeviceId 기준으로 변경 - Device 관련 DTO 10개 DeviceId long → string 변경 - DeviceRegisterRequestDto에 device_id (UUID, Required) 필드 추가 - DeviceService / PushService / PushWorker ExternalDeviceId 기반 로직 적용 - EF Core Migration AddExternalDeviceId 추가 ## 🔗 관련 이슈 (Related Issues) Closes #275 ## 🛠️ 작업 내용 (Changes) - [x] SPMS.Domain/Entities/Device.cs — ExternalDeviceId 프로퍼티 추가 - [x] SPMS.Infrastructure/Persistence/Configurations/DeviceConfiguration.cs — VARCHAR(36), UNIQUE INDEX 추가 - [x] SPMS.Domain/Interfaces/IDeviceRepository.cs — GetByExternalIdAndServiceAsync 추가 - [x] SPMS.Infrastructure/Persistence/Repositories/DeviceRepository.cs — 구현 - [x] SPMS.Application/Interfaces/ITokenCacheService.cs — long → string - [x] SPMS.Infrastructure/Caching/TokenCacheService.cs — 구현 동기화 - [x] Device DTO 10개 — DeviceId long → string - [x] SPMS.Application/Services/DeviceService.cs — ExternalDeviceId 기준 로직 - [x] SPMS.Application/Services/PushService.cs — UUID string 배열 직렬화 - [x] SPMS.Infrastructure/Workers/PushWorker.cs — ExternalDeviceId 기준 파싱 - [x] SPMS.Infrastructure/Workers/DeadTokenCleanupWorker.cs — 캐시 무효화 수정 - [x] SPMS.Infrastructure/Persistence/Repositories/PushSendLogRepository.cs — Device Include 추가 - [x] Migration/AddExternalDeviceId — 컬럼 + UNIQUE INDEX ## 📢 리뷰어 참고 사항 (To Reviewers) - Device.Id(bigint, PK)는 유지, ExternalDeviceId만 외부 노출 - 기존 DB 레코드에 ExternalDeviceId가 비어있으면 다음 등록 요청 시 채워짐 - 캐시 키가 변경되었으므로 배포 후 기존 캐시는 자동 만료됨 ## ✅ 체크리스트 (Self Checklist) - [x] 빌드(Build)가 성공적으로 수행되었는가? - [x] 모든 단위 테스트(Unit Test)를 통과하였는가? - [x] 불필요한 로그나 주석을 제거하였는가? - [x] 컨벤션(Clean Architecture, Naming)을 준수하였는가? - [x] 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가? ## 📸 스크린샷 / 테스트 로그 (Screenshots/Logs)
seonkyu.kim added 1 commit 2026-03-03 03:56:44 +00:00
seonkyu.kim added the
Priority
High
Status
In Progress
Type
Improvement
labels 2026-03-03 03:57:10 +00:00
seonkyu.kim requested review from Owners 2026-03-03 03:57:14 +00:00
seonkyu.kim merged commit b2485569be into develop 2026-03-03 03:57:52 +00:00
seonkyu.kim deleted branch improvement/#275-external-device-id 2026-03-03 03:58:15 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-03-03 04:03:34 +00:00
Sign in to join this conversation.
No description provided.