feat: 파일 업로드/조회/삭제 API 구현 (#98) #99

Merged
seonkyu.kim merged 1 commits from feature/#98-file-crud into develop 2026-02-10 06:15:18 +00:00
Owner

📋 작업 요약

  • 파일 업로드(multipart/form-data), 조회, 목록, 삭제(Soft Delete) API 4개 구현
  • FileEntity에 IsDeleted/DeletedAt 컬럼 추가 (Soft Delete 정책)
  • IFileStorageService 추상화로 로컬 파일 저장 구현
  • 파일 타입/크기 검증 (image: jpg/png/gif 5MB, csv: 50MB)

Closes #98

🛠️ 작업 내용 (Changes)

  • SPMS.Domain/Entities/FileEntity.cs — IsDeleted, DeletedAt 컬럼 추가
  • SPMS.Domain/Common/ErrorCodes.cs — File 에러코드 추가 (181~183)
  • SPMS.Domain/Interfaces/IFileRepository.cs — GetByIdAndServiceAsync, GetPagedByServiceAsync 추가
  • SPMS.Infrastructure/Persistence/Configurations/FileEntityConfiguration.cs — Soft Delete 컬럼 매핑
  • SPMS.Infrastructure/Persistence/Repositories/FileRepository.cs — 새 파일, 레포지토리 구현
  • SPMS.Infrastructure/Services/LocalFileStorageService.cs — 새 파일, 로컬 파일 저장 서비스
  • SPMS.Infrastructure/Migrations/AddFileEntitySoftDelete.cs — 마이그레이션
  • SPMS.Application/DTOs/File/*.cs — 8개 DTO (Upload/Info/List/Delete Request/Response + Summary)
  • SPMS.Application/Interfaces/IFileService.cs — 새 파일, 서비스 인터페이스
  • SPMS.Application/Interfaces/IFileStorageService.cs — 새 파일, 파일 저장 추상화
  • SPMS.Application/Services/FileService.cs — 새 파일, 비즈니스 로직 구현
  • SPMS.API/Controllers/FileController.cs — 새 파일, 4개 엔드포인트
  • SPMS.API/appsettings.json — FileStorage 설정 추가
  • SPMS.Application/DependencyInjection.cs — IFileService 등록
  • SPMS.Infrastructure/DependencyInjection.cs — IFileRepository, IFileStorageService 등록

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

  • 모든 File API는 JWT + X-Service-Code 헤더 필수 (대시보드 API)
  • Upload는 multipart/form-data로 file + file_type 수신, service_code는 X-Service-Code 헤더에서 획득
  • IFileStorageService 추상화를 통해 향후 S3/CDN 전환 용이
  • FileService는 Stream 기반으로 ASP.NET 의존성 제거 (Clean Architecture 준수)

체크리스트 (Self Checklist)

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

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

빌드했습니다.
    경고 0개
    오류 0개
## 📋 작업 요약 - 파일 업로드(multipart/form-data), 조회, 목록, 삭제(Soft Delete) API 4개 구현 - FileEntity에 IsDeleted/DeletedAt 컬럼 추가 (Soft Delete 정책) - IFileStorageService 추상화로 로컬 파일 저장 구현 - 파일 타입/크기 검증 (image: jpg/png/gif 5MB, csv: 50MB) ## 🔗 관련 이슈 (Related Issues) Closes #98 ## 🛠️ 작업 내용 (Changes) - [x] `SPMS.Domain/Entities/FileEntity.cs` — IsDeleted, DeletedAt 컬럼 추가 - [x] `SPMS.Domain/Common/ErrorCodes.cs` — File 에러코드 추가 (181~183) - [x] `SPMS.Domain/Interfaces/IFileRepository.cs` — GetByIdAndServiceAsync, GetPagedByServiceAsync 추가 - [x] `SPMS.Infrastructure/Persistence/Configurations/FileEntityConfiguration.cs` — Soft Delete 컬럼 매핑 - [x] `SPMS.Infrastructure/Persistence/Repositories/FileRepository.cs` — 새 파일, 레포지토리 구현 - [x] `SPMS.Infrastructure/Services/LocalFileStorageService.cs` — 새 파일, 로컬 파일 저장 서비스 - [x] `SPMS.Infrastructure/Migrations/AddFileEntitySoftDelete.cs` — 마이그레이션 - [x] `SPMS.Application/DTOs/File/*.cs` — 8개 DTO (Upload/Info/List/Delete Request/Response + Summary) - [x] `SPMS.Application/Interfaces/IFileService.cs` — 새 파일, 서비스 인터페이스 - [x] `SPMS.Application/Interfaces/IFileStorageService.cs` — 새 파일, 파일 저장 추상화 - [x] `SPMS.Application/Services/FileService.cs` — 새 파일, 비즈니스 로직 구현 - [x] `SPMS.API/Controllers/FileController.cs` — 새 파일, 4개 엔드포인트 - [x] `SPMS.API/appsettings.json` — FileStorage 설정 추가 - [x] `SPMS.Application/DependencyInjection.cs` — IFileService 등록 - [x] `SPMS.Infrastructure/DependencyInjection.cs` — IFileRepository, IFileStorageService 등록 ## 📢 리뷰어 참고 사항 (To Reviewers) - 모든 File API는 JWT + X-Service-Code 헤더 필수 (대시보드 API) - Upload는 multipart/form-data로 file + file_type 수신, service_code는 X-Service-Code 헤더에서 획득 - IFileStorageService 추상화를 통해 향후 S3/CDN 전환 용이 - FileService는 Stream 기반으로 ASP.NET 의존성 제거 (Clean Architecture 준수) ## ✅ 체크리스트 (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 06:03:57 +00:00
seonkyu.kim added the
Priority
Medium
Status
In Progress
Type
Feature
labels 2026-02-10 06:04:07 +00:00
seonkyu.kim self-assigned this 2026-02-10 06:04:09 +00:00
seonkyu.kim added this to the Phase 2-2: Public & 디바이스 & 파일 API milestone 2026-02-10 06:04:15 +00:00
seonkyu.kim requested review from Owners 2026-02-10 06:04:27 +00:00
seonkyu.kim merged commit b661fb5a08 into develop 2026-02-10 06:15:18 +00:00
seonkyu.kim deleted branch feature/#98-file-crud 2026-02-10 06:15:34 +00:00
seonkyu.kim added
Status
Done
and removed
Status
In Progress
labels 2026-02-10 06:15:54 +00:00
Sign in to join this conversation.
No description provided.