Browse Source

add config item attachments

visuddhinanda 2 years ago
parent
commit
2c4bba5d3a

+ 1 - 1
app/Console/Commands/ExportZip.php

@@ -96,7 +96,7 @@ class ExportZip extends Command
                 ];
                 ];
         }
         }
 
 
-        $bucket = config('mint.attachments_bucket_name');
+        $bucket = config('mint.attachments.bucket_name.temporary');
         $tmpFile =  $bucket.'/'. $zipFile ;
         $tmpFile =  $bucket.'/'. $zipFile ;
 
 
         $this->info('upload file='.$tmpFile);
         $this->info('upload file='.$tmpFile);

+ 1 - 1
app/Http/Controllers/OfflineIndexController.php

@@ -24,7 +24,7 @@ class OfflineIndexController extends Controller
             $fileInfo = RedisClusters::get('/offline/index');
             $fileInfo = RedisClusters::get('/offline/index');
             foreach ($fileInfo as $key => $file) {
             foreach ($fileInfo as $key => $file) {
                 $zipFile = $file['filename'];
                 $zipFile = $file['filename'];
-                $bucket = config('mint.attachments_bucket_name');
+                $bucket = config('mint.attachments.bucket_name.temporary');
                 $tmpFile =  $bucket.'/'. $zipFile ;
                 $tmpFile =  $bucket.'/'. $zipFile ;
                 $url = array();
                 $url = array();
                 foreach (config('mint.server.cdn_urls') as $key => $cdn) {
                 foreach (config('mint.server.cdn_urls') as $key => $cdn) {

+ 6 - 1
config/mint.php

@@ -30,7 +30,12 @@ return [
 
 
     ],
     ],
 
 
-    'attachments_bucket_name' => env('ATTACHMENTS_BUCKET_NAME', "attachments-staging"),
+    'attachments' => [
+        'bucket_name' => [
+            'temporary' => env('ATTACHMENTS_TEMPORARY_BUCKET_NAME', "attachments-staging"),
+            'permanent' => env('ATTACHMENTS_PERMANENT_BUCKET_NAME', "attachments-staging"),
+        ],
+    ],
 
 
     'cache' => [
     'cache' => [
         //这个值prod,staging无需设置
         //这个值prod,staging无需设置