chore(server) refactor serveFile and downloadFile endpoint (#978)

This commit is contained in:
Alex
2022-11-16 00:11:16 -06:00
committed by GitHub
parent 1db255fd3e
commit e799f35dd2
19 changed files with 116 additions and 175 deletions

View File

@@ -12,7 +12,7 @@ Method | HTTP request | Description
[**checkDuplicateAsset**](AssetApi.md#checkduplicateasset) | **POST** /asset/check |
[**checkExistingAssets**](AssetApi.md#checkexistingassets) | **POST** /asset/exist |
[**deleteAsset**](AssetApi.md#deleteasset) | **DELETE** /asset |
[**downloadFile**](AssetApi.md#downloadfile) | **GET** /asset/download |
[**downloadFile**](AssetApi.md#downloadfile) | **GET** /asset/download/{assetId} |
[**downloadLibrary**](AssetApi.md#downloadlibrary) | **GET** /asset/download-library |
[**getAllAssets**](AssetApi.md#getallassets) | **GET** /asset |
[**getAssetById**](AssetApi.md#getassetbyid) | **GET** /asset/assetById/{assetId} |
@@ -25,7 +25,7 @@ Method | HTTP request | Description
[**getCuratedObjects**](AssetApi.md#getcuratedobjects) | **GET** /asset/curated-objects |
[**getUserAssetsByDeviceId**](AssetApi.md#getuserassetsbydeviceid) | **GET** /asset/{deviceId} |
[**searchAsset**](AssetApi.md#searchasset) | **POST** /asset/search |
[**serveFile**](AssetApi.md#servefile) | **GET** /asset/file |
[**serveFile**](AssetApi.md#servefile) | **GET** /asset/file/{assetId} |
[**updateAssetById**](AssetApi.md#updateassetbyid) | **PUT** /asset/assetById/{assetId} |
[**uploadFile**](AssetApi.md#uploadfile) | **POST** /asset/upload |
@@ -176,7 +176,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **downloadFile**
> Object downloadFile(aid, did, isThumb, isWeb)
> Object downloadFile(assetId, isThumb, isWeb)
@@ -191,13 +191,12 @@ import 'package:openapi/api.dart';
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final aid = aid_example; // String |
final did = did_example; // String |
final assetId = assetId_example; // String |
final isThumb = true; // bool |
final isWeb = true; // bool |
try {
final result = api_instance.downloadFile(aid, did, isThumb, isWeb);
final result = api_instance.downloadFile(assetId, isThumb, isWeb);
print(result);
} catch (e) {
print('Exception when calling AssetApi->downloadFile: $e\n');
@@ -208,8 +207,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**aid** | **String**| |
**did** | **String**| |
**assetId** | **String**| |
**isThumb** | **bool**| | [optional]
**isWeb** | **bool**| | [optional]
@@ -781,7 +779,7 @@ Name | Type | Description | Notes
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **serveFile**
> Object serveFile(aid, did, isThumb, isWeb)
> Object serveFile(assetId, isThumb, isWeb)
@@ -796,13 +794,12 @@ import 'package:openapi/api.dart';
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);
final api_instance = AssetApi();
final aid = aid_example; // String |
final did = did_example; // String |
final assetId = assetId_example; // String |
final isThumb = true; // bool |
final isWeb = true; // bool |
try {
final result = api_instance.serveFile(aid, did, isThumb, isWeb);
final result = api_instance.serveFile(assetId, isThumb, isWeb);
print(result);
} catch (e) {
print('Exception when calling AssetApi->serveFile: $e\n');
@@ -813,8 +810,7 @@ try {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**aid** | **String**| |
**did** | **String**| |
**assetId** | **String**| |
**isThumb** | **bool**| | [optional]
**isWeb** | **bool**| | [optional]