feat: parse file
This commit is contained in:
parent
f1887d2d9b
commit
54f40c8ce2
1 changed files with 22 additions and 0 deletions
|
@ -3,7 +3,9 @@
|
|||
namespace Appwrite\Utopia\Response\Filter;
|
||||
|
||||
use Appwrite\Auth\Auth;
|
||||
use Appwrite\Database\Database;
|
||||
use Appwrite\Database\Validator\Authorization;
|
||||
use Appwrite\OpenSSL\OpenSSL;
|
||||
use Appwrite\Utopia\Response;
|
||||
use Appwrite\Utopia\Response\Filter;
|
||||
use Exception;
|
||||
|
@ -19,6 +21,10 @@ class V06 extends Filter {
|
|||
|
||||
switch($model) {
|
||||
|
||||
case Response::MODEL_FILE :
|
||||
$parsedResponse = $this->parseFile($content);
|
||||
break;
|
||||
|
||||
case Response::MODEL_USER :
|
||||
$parsedResponse = $this->parseUser($content);
|
||||
break;
|
||||
|
@ -90,6 +96,22 @@ class V06 extends Filter {
|
|||
return $parsedResponse;
|
||||
}
|
||||
|
||||
private function parseFile(array $content)
|
||||
{
|
||||
$content['$collection'] = Database::SYSTEM_COLLECTION_FILES;
|
||||
$content['algorithm'] = 'gzip';
|
||||
$content['comment'] = '';
|
||||
$content['fileOpenSSLCipher'] = OpenSSL::CIPHER_AES_128_GCM;
|
||||
$content['fileOpenSSLIV'] = '';
|
||||
$content['fileOpenSSLTag'] = '';
|
||||
$content['fileOpenSSLVersion'] = '';
|
||||
$content['folderId'] = '';
|
||||
$content['path'] = '';
|
||||
$content['sizeActual'] = $content['sizeOriginal'];
|
||||
$content['token'] = '';
|
||||
return $content;
|
||||
}
|
||||
|
||||
private function parseCurrencyList(array $content)
|
||||
{
|
||||
$content['locations'] = [];
|
||||
|
|
Loading…
Reference in a new issue