feat: 예약 발송 등록/취소 API 구현 (#116) #117

Merged
seonkyu.kim merged 1 commits from feature/#116-push-schedule-api into develop 2026-02-10 08:11:07 +00:00
Owner

📋 작업 요약

  • 예약 발송 등록 API (POST /v1/in/push/schedule) 구현
  • 예약 취소 API (POST /v1/in/push/schedule/cancel) 구현
  • Redis 기반 예약 취소 추적 및 ScheduleWorker 취소 체크 로직

Closes #116

🛠️ 작업 내용 (Changes)

  • SPMS.Application/DTOs/Push/PushScheduleRequestDto.cs — 예약 발송 요청 DTO (message_code, send_type, device_id, tags, scheduled_at, variables)
  • SPMS.Application/DTOs/Push/PushScheduleCancelRequestDto.cs — 예약 취소 요청 DTO (schedule_id)
  • SPMS.Application/DTOs/Push/PushScheduleResponseDto.cs — 예약 발송 응답 DTO (schedule_id, scheduled_at, status)
  • SPMS.Application/Interfaces/IScheduleCancelStore.cs — 예약 취소 저장소 인터페이스
  • SPMS.Application/Interfaces/IPushService.cs — ScheduleAsync, CancelScheduleAsync 메서드 추가
  • SPMS.Application/Services/PushService.cs — 예약 발송/취소 로직 구현
  • SPMS.Infrastructure/Caching/ScheduleCancelStore.cs — Redis 기반 예약 취소 저장소 (7일 TTL)
  • SPMS.Infrastructure/Workers/ScheduleWorker.cs — 취소된 예약 메시지 ACK 후 스킵 로직 추가
  • SPMS.Infrastructure/DependencyInjection.cs — IScheduleCancelStore DI 등록
  • SPMS.API/Controllers/PushController.cs — schedule, schedule/cancel 엔드포인트 추가

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

  • 예약 발송은 ScheduleMessageDto를 RabbitMQ schedule queue에 발행, ScheduleWorker가 시간 도래 시 push queue로 전달
  • 예약 취소는 Redis에 schedule_cancel:{scheduleId} 키를 등록하여 ScheduleWorker가 폴링 시 ACK 후 스킵
  • Redis 취소 키 TTL은 7일 (예약 메시지가 큐에 남아있는 최대 기간 고려)
  • send_type은 "single"과 "tag"만 허용 (bulk은 별도 API)

체크리스트 (Self Checklist)

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

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

빌드했습니다.
    경고 0개
    오류 0개
## 📋 작업 요약 - 예약 발송 등록 API (`POST /v1/in/push/schedule`) 구현 - 예약 취소 API (`POST /v1/in/push/schedule/cancel`) 구현 - Redis 기반 예약 취소 추적 및 ScheduleWorker 취소 체크 로직 ## 🔗 관련 이슈 (Related Issues) Closes #116 ## 🛠️ 작업 내용 (Changes) - [x] `SPMS.Application/DTOs/Push/PushScheduleRequestDto.cs` — 예약 발송 요청 DTO (message_code, send_type, device_id, tags, scheduled_at, variables) - [x] `SPMS.Application/DTOs/Push/PushScheduleCancelRequestDto.cs` — 예약 취소 요청 DTO (schedule_id) - [x] `SPMS.Application/DTOs/Push/PushScheduleResponseDto.cs` — 예약 발송 응답 DTO (schedule_id, scheduled_at, status) - [x] `SPMS.Application/Interfaces/IScheduleCancelStore.cs` — 예약 취소 저장소 인터페이스 - [x] `SPMS.Application/Interfaces/IPushService.cs` — ScheduleAsync, CancelScheduleAsync 메서드 추가 - [x] `SPMS.Application/Services/PushService.cs` — 예약 발송/취소 로직 구현 - [x] `SPMS.Infrastructure/Caching/ScheduleCancelStore.cs` — Redis 기반 예약 취소 저장소 (7일 TTL) - [x] `SPMS.Infrastructure/Workers/ScheduleWorker.cs` — 취소된 예약 메시지 ACK 후 스킵 로직 추가 - [x] `SPMS.Infrastructure/DependencyInjection.cs` — IScheduleCancelStore DI 등록 - [x] `SPMS.API/Controllers/PushController.cs` — schedule, schedule/cancel 엔드포인트 추가 ## 📢 리뷰어 참고 사항 (To Reviewers) - 예약 발송은 ScheduleMessageDto를 RabbitMQ schedule queue에 발행, ScheduleWorker가 시간 도래 시 push queue로 전달 - 예약 취소는 Redis에 `schedule_cancel:{scheduleId}` 키를 등록하여 ScheduleWorker가 폴링 시 ACK 후 스킵 - Redis 취소 키 TTL은 7일 (예약 메시지가 큐에 남아있는 최대 기간 고려) - send_type은 "single"과 "tag"만 허용 (bulk은 별도 API) ## ✅ 체크리스트 (Self Checklist) - [x] 빌드(Build)가 성공적으로 수행되었는가? - [x] 모든 단위 테스트(Unit Test)를 통과하였는가? - [x] 불필요한 로그나 주석을 제거하였는가? - [x] 컨벤션(Clean Architecture, Naming)을 준수하였는가? - [x] 기밀 정보(비밀번호, 키 등)가 하드코딩 되어있지 않은가? ## 📸 스크린샷 / 테스트 로그 (Screenshots/Logs) ``` 빌드했습니다. 경고 0개 오류 0개 ```
seonkyu.kim added 1 commit 2026-02-10 08:06:38 +00:00
- POST /v1/in/push/schedule (예약 발송 등록)
- POST /v1/in/push/schedule/cancel (예약 취소)
- ScheduleCancelStore: Redis 기반 예약 취소 추적
- ScheduleWorker: 취소된 예약 메시지 ACK 후 스킵 로직 추가

Closes #116
seonkyu.kim added the
Priority
High
Status
In Progress
Type
Feature
labels 2026-02-10 08:06:46 +00:00
seonkyu.kim added this to the Phase 3: 메시지 & Push Core milestone 2026-02-10 08:06:50 +00:00
seonkyu.kim self-assigned this 2026-02-10 08:07:59 +00:00
seonkyu.kim merged commit fc16884d25 into develop 2026-02-10 08:11:07 +00:00
seonkyu.kim deleted branch feature/#116-push-schedule-api 2026-02-10 08:11:26 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-02-10 08:11:58 +00:00
Sign in to join this conversation.
No description provided.