feat: 메시지 CRUD API 구현 (#128) #129

Merged
seonkyu.kim merged 2 commits from feature/#128-message-crud-api into develop 2026-02-10 13:43:30 +00:00
Owner

📋 작업 요약

API_Specification.md §6.1~6.4 기준 메시지 CRUD API 4개를 구현합니다.

Closes #128

🛠️ 작업 내용 (Changes)

신규 API 엔드포인트

API URI 설명
6.1 POST /v1/in/message/save 메시지 저장 (message_code 자동 생성)
6.2 POST /v1/in/message/list 메시지 목록 조회 (페이지네이션, keyword/is_active 필터)
6.3 POST /v1/in/message/info 메시지 상세 조회 (템플릿 변수 추출 포함)
6.4 POST /v1/in/message/delete 메시지 삭제 (Soft Delete)

주요 구현 사항

  • message_code 생성: (접두 랜덤 3자리)(순번 4자리)(접미 랜덤 3자리) — DB_Schema.md §3 규칙 준수
  • 변수 추출: {{변수명}} 패턴을 title/body에서 추출하여 variables 필드 반환
  • Soft Delete: IsDeleted=true, DeletedAt 설정 (Hard Delete는 스케줄러에서 처리)

변경 파일

  • SPMS.API/Controllers/MessageController.cs — save, list, info, delete 엔드포인트 추가
  • SPMS.Application/Interfaces/IMessageService.cs — SaveAsync, GetListAsync, GetInfoAsync, DeleteAsync 추가
  • SPMS.Application/Services/MessageService.cs — CRUD 로직 및 message_code 생성
  • SPMS.Application/DTOs/Message/ — 7개 DTO 신규
  • SPMS.Domain/Interfaces/IMessageRepository.cs — GetTodaySequenceAsync, GetPagedByServiceAsync 추가
  • SPMS.Infrastructure/Persistence/Repositories/MessageRepository.cs — 구현
  • TASKS.md — Phase 3 테이블 API Spec 기준 재정비

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

  • 메시지는 수정 불가 (삭제 후 새로 생성) — API Spec 규칙
  • message_code 접두/접미는 날짜+serviceId 기반 시드로 하루 단위 변경
  • TASKS.md에 API Spec 미정의 항목(딥링크/재발송) 보류 처리됨

체크리스트 (Self Checklist)

  • 빌드 성공 (경고 0, 오류 0)
  • ApiResponse 패턴 준수
  • Entity 직접 반환 없음 (DTO 사용)
  • async/await 사용
  • X-Service-Code 기반 서비스 식별
  • Soft Delete 정책 준수

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

빌드했습니다.
    경고 0개
    오류 0개
## 📋 작업 요약 API_Specification.md §6.1~6.4 기준 메시지 CRUD API 4개를 구현합니다. ## 🔗 관련 이슈 (Related Issues) Closes #128 ## 🛠️ 작업 내용 (Changes) ### 신규 API 엔드포인트 | API | URI | 설명 | |-----|-----|------| | 6.1 | `POST /v1/in/message/save` | 메시지 저장 (message_code 자동 생성) | | 6.2 | `POST /v1/in/message/list` | 메시지 목록 조회 (페이지네이션, keyword/is_active 필터) | | 6.3 | `POST /v1/in/message/info` | 메시지 상세 조회 (템플릿 변수 추출 포함) | | 6.4 | `POST /v1/in/message/delete` | 메시지 삭제 (Soft Delete) | ### 주요 구현 사항 - **message_code 생성**: `(접두 랜덤 3자리)(순번 4자리)(접미 랜덤 3자리)` — DB_Schema.md §3 규칙 준수 - **변수 추출**: `{{변수명}}` 패턴을 title/body에서 추출하여 variables 필드 반환 - **Soft Delete**: IsDeleted=true, DeletedAt 설정 (Hard Delete는 스케줄러에서 처리) ### 변경 파일 - `SPMS.API/Controllers/MessageController.cs` — save, list, info, delete 엔드포인트 추가 - `SPMS.Application/Interfaces/IMessageService.cs` — SaveAsync, GetListAsync, GetInfoAsync, DeleteAsync 추가 - `SPMS.Application/Services/MessageService.cs` — CRUD 로직 및 message_code 생성 - `SPMS.Application/DTOs/Message/` — 7개 DTO 신규 - `SPMS.Domain/Interfaces/IMessageRepository.cs` — GetTodaySequenceAsync, GetPagedByServiceAsync 추가 - `SPMS.Infrastructure/Persistence/Repositories/MessageRepository.cs` — 구현 - `TASKS.md` — Phase 3 테이블 API Spec 기준 재정비 ## 📢 리뷰어 참고 사항 (To Reviewers) - 메시지는 **수정 불가** (삭제 후 새로 생성) — API Spec 규칙 - message_code 접두/접미는 날짜+serviceId 기반 시드로 하루 단위 변경 - TASKS.md에 API Spec 미정의 항목(딥링크/재발송) 보류 처리됨 ## ✅ 체크리스트 (Self Checklist) - [x] 빌드 성공 (경고 0, 오류 0) - [x] ApiResponse 패턴 준수 - [x] Entity 직접 반환 없음 (DTO 사용) - [x] async/await 사용 - [x] X-Service-Code 기반 서비스 식별 - [x] Soft Delete 정책 준수 ## 📸 스크린샷 / 테스트 로그 (Screenshots/Logs) ``` 빌드했습니다. 경고 0개 오류 0개 ```
seonkyu.kim added 2 commits 2026-02-10 13:39:20 +00:00
- 메시지 저장 API (POST /v1/in/message/save)
- 메시지 목록 조회 API (POST /v1/in/message/list)
- 메시지 상세 조회 API (POST /v1/in/message/info)
- 메시지 삭제 API (POST /v1/in/message/delete)
- message_code 자동 생성 (접두3+순번4+접미3)
- 변수 추출 ({{변수명}} 패턴)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- API_Specification.md 기준으로 Phase 3 테이블 재구성
- 미구현 API 7개 추가 (Message 6.1~6.4, Push 7.3~7.5)
- Feature_Spec 전용 항목(딥링크/재발송) 보류 처리

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
seonkyu.kim added the
Priority
High
Status
In Progress
Type
Feature
labels 2026-02-10 13:39:27 +00:00
seonkyu.kim added this to the Phase 3: 메시지 & Push Core milestone 2026-02-10 13:39:29 +00:00
seonkyu.kim self-assigned this 2026-02-10 13:39:32 +00:00
seonkyu.kim requested review from Owners 2026-02-10 13:39:41 +00:00
seonkyu.kim merged commit dc487609b3 into develop 2026-02-10 13:43:30 +00:00
seonkyu.kim deleted branch feature/#128-message-crud-api 2026-02-10 13:43:42 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-02-10 13:43:56 +00:00
Sign in to join this conversation.
No description provided.