style: Pint 포맷팅 적용
This commit is contained in:
@@ -7,10 +7,9 @@
|
||||
use App\Models\System\Schedule;
|
||||
use App\Services\GoogleCloudStorageService;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@@ -174,7 +173,7 @@ public function uploadFiles(Request $request, int $scheduleId, GoogleCloudStorag
|
||||
|
||||
foreach ($request->file('files') as $file) {
|
||||
$originalName = $file->getClientOriginalName();
|
||||
$storedName = Str::random(40) . '.' . $file->getClientOriginalExtension();
|
||||
$storedName = Str::random(40).'.'.$file->getClientOriginalExtension();
|
||||
$storagePath = "schedules/{$tenantId}/{$schedule->id}/{$storedName}";
|
||||
|
||||
// 로컬(tenant 디스크) 저장
|
||||
@@ -215,7 +214,7 @@ public function uploadFiles(Request $request, int $scheduleId, GoogleCloudStorag
|
||||
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => count($uploaded) . '개 파일이 업로드되었습니다.',
|
||||
'message' => count($uploaded).'개 파일이 업로드되었습니다.',
|
||||
'files' => $uploaded,
|
||||
]);
|
||||
}
|
||||
@@ -274,9 +273,16 @@ public function downloadFile(int $scheduleId, int $fileId)
|
||||
*/
|
||||
private function determineFileType(string $mimeType): string
|
||||
{
|
||||
if (str_starts_with($mimeType, 'image/')) return 'image';
|
||||
if (str_contains($mimeType, 'spreadsheet') || str_contains($mimeType, 'excel')) return 'excel';
|
||||
if (str_contains($mimeType, 'zip') || str_contains($mimeType, 'rar') || str_contains($mimeType, 'archive')) return 'archive';
|
||||
if (str_starts_with($mimeType, 'image/')) {
|
||||
return 'image';
|
||||
}
|
||||
if (str_contains($mimeType, 'spreadsheet') || str_contains($mimeType, 'excel')) {
|
||||
return 'excel';
|
||||
}
|
||||
if (str_contains($mimeType, 'zip') || str_contains($mimeType, 'rar') || str_contains($mimeType, 'archive')) {
|
||||
return 'archive';
|
||||
}
|
||||
|
||||
return 'document';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user