Media Manager
Tenant kullanicilarinin gorsel, video ve dokuman dosyalarini MinIO uzerinde yonettigi modul.
Base URL: /api/tenant/media-manager/files
Yetkilendirme: Bearer Token + X-Api-Key
Modul: media-manager modulu musteriye atanmis olmalidir.
Headers:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...
X-Api-Key: customer-api-key
Desteklenen uzantilar:
- Gorsel:
jpg,jpeg,png,webp,gif,svg - Video:
mp4,webm,mov - Dokuman:
pdf,doc,docx,csv
Maksimum dosya boyutu tenant bazinda Base DB'deki Customer.MaxUploadFileSizeMb alanindan okunur. Varsayilan deger 10 MB'dir.
POST /
Tek dosya yukler.
Content-Type: multipart/form-data
Form Data:
| Alan | Tip | Zorunlu | Aciklama |
|---|---|---|---|
file | file | Evet | Yuklenecek tek dosya |
Response - 201 Created:
{
"success": true,
"data": {
"id": "media-id",
"originalFileName": "urun-katalogu.pdf",
"storedFileName": "f9cc9bbcc17f4635b4b8766d939e6043.pdf",
"objectPath": "media/2026/03/f9cc9bbcc17f4635b4b8766d939e6043.pdf",
"contentType": "application/pdf",
"extension": ".pdf",
"fileCategory": "document",
"sizeBytes": 481920,
"publicUrl": "https://api.example.com/media/acme/f9cc9bbcc17f4635b4b8766d939e6043.pdf",
"isPublic": true,
"uploadedByUserId": "user-id",
"createdAt": "2026-03-27T18:45:00Z"
}
}
Bu endpoint genel amaclidir; dosyayi optimize etmeden saklar.
POST /images/optimized
Sadece raster gorsel yukler. Yukleme sirasinda:
- metadata temizlenir
- gorsel auto-orient uygulanir
- ayni format korunarak yeniden encode edilir
- dosya boyutu dusurulmeye calisilir
Format donusumu yapilmaz.
Content-Type: multipart/form-data
Desteklenen formatlar: jpg, jpeg, png, webp, gif
svg bu endpoint tarafinda optimize edilmez. svg yuklemek icin standart POST / endpoint'i kullanilmalidir.
Form Data:
| Alan | Tip | Zorunlu | Aciklama |
|---|---|---|---|
file | file | Evet | Optimize edilerek yuklenecek gorsel |
Response - 201 Created: MediaFileResponse
Varsayilan olarak isPublic = true gelir.
GET /
Dosyalari arama, filtreleme ve pagination ile listeler.
Query Parametreleri:
| Parametre | Tip | Varsayilan | Aciklama |
|---|---|---|---|
search | string | - | Orijinal veya uniq dosya adinda arama |
fileCategory | string | - | image, video, document |
isPublic | boolean | - | Public dosyalari filtreler |
page | int | 1 | Sayfa numarasi |
pageSize | int | 20 | Sayfa basi kayit |
Response - 200 OK:
{
"success": true,
"data": {
"items": [
{
"id": "media-id",
"originalFileName": "hero-banner.webp",
"storedFileName": "cc4d4a1df9894a8da60f0a5e8cb8583d.webp",
"contentType": "image/webp",
"extension": ".webp",
"fileCategory": "image",
"sizeBytes": 146281,
"publicUrl": "https://api.example.com/media/acme/cc4d4a1df9894a8da60f0a5e8cb8583d.webp",
"isPublic": true,
"createdAt": "2026-03-27T18:46:00Z"
}
],
"page": 1,
"pageSize": 20,
"totalCount": 1,
"totalPages": 1
}
}
GET /{id}
Tek dosya detayini getirir.
Response - 200 OK: MediaFileResponse
PUT /{id}/visibility
Dosyanin public olarak paylasilip paylasilmayacagini gunceller.
Request Body:
{
"isPublic": true
}
Response - 200 OK: MediaFileResponse
Yeni yuklenen dosyalar varsayilan olarak isPublic = true gelir. Bu endpoint ile dosya sonradan private veya public yapilabilir.
DELETE /{id}
Dosyayi MinIO'dan fiziksel olarak siler, tenant DB'de kaydi soft delete yapar.
Response - 204 No Content
Olası Hatalar
| Kod | Durum |
|---|---|
400 | Desteklenmeyen uzanti, bos dosya veya page/pageSize hatasi |
400 | Dosya boyutu tenant limiti asiyor |
401 | Token veya X-Api-Key eksik/gecersiz |
403 | media-manager modulu tenant'a atanmis degil |
404 | Dosya bulunamadi |