mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(web+server): map improvements (#2498)
* feat(web+server): map improvements * add number format double to fix mobile
This commit is contained in:
10
mobile/openapi/doc/AssetApi.md
generated
10
mobile/openapi/doc/AssetApi.md
generated
@@ -1041,12 +1041,10 @@ This endpoint does not need any parameter.
|
||||
[[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)
|
||||
|
||||
# **getMapMarkers**
|
||||
> List<MapMarkerResponseDto> getMapMarkers(isFavorite, isArchived, skip)
|
||||
> List<MapMarkerResponseDto> getMapMarkers(isFavorite)
|
||||
|
||||
|
||||
|
||||
Get all assets that have GPS information embedded
|
||||
|
||||
### Example
|
||||
```dart
|
||||
import 'package:openapi/api.dart';
|
||||
@@ -1067,11 +1065,9 @@ import 'package:openapi/api.dart';
|
||||
|
||||
final api_instance = AssetApi();
|
||||
final isFavorite = true; // bool |
|
||||
final isArchived = true; // bool |
|
||||
final skip = 8.14; // num |
|
||||
|
||||
try {
|
||||
final result = api_instance.getMapMarkers(isFavorite, isArchived, skip);
|
||||
final result = api_instance.getMapMarkers(isFavorite);
|
||||
print(result);
|
||||
} catch (e) {
|
||||
print('Exception when calling AssetApi->getMapMarkers: $e\n');
|
||||
@@ -1083,8 +1079,6 @@ try {
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**isFavorite** | **bool**| | [optional]
|
||||
**isArchived** | **bool**| | [optional]
|
||||
**skip** | **num**| | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
3
mobile/openapi/doc/MapMarkerResponseDto.md
generated
3
mobile/openapi/doc/MapMarkerResponseDto.md
generated
@@ -8,10 +8,9 @@ import 'package:openapi/api.dart';
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**type** | [**AssetTypeEnum**](AssetTypeEnum.md) | |
|
||||
**id** | **String** | |
|
||||
**lat** | **double** | |
|
||||
**lon** | **double** | |
|
||||
**id** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
27
mobile/openapi/lib/api/asset_api.dart
generated
27
mobile/openapi/lib/api/asset_api.dart
generated
@@ -979,18 +979,11 @@ class AssetApi {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// Get all assets that have GPS information embedded
|
||||
///
|
||||
/// Note: This method returns the HTTP [Response].
|
||||
///
|
||||
/// Performs an HTTP 'GET /asset/map-marker' operation and returns the [Response].
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] isFavorite:
|
||||
///
|
||||
/// * [bool] isArchived:
|
||||
///
|
||||
/// * [num] skip:
|
||||
Future<Response> getMapMarkersWithHttpInfo({ bool? isFavorite, bool? isArchived, num? skip, }) async {
|
||||
Future<Response> getMapMarkersWithHttpInfo({ bool? isFavorite, }) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final path = r'/asset/map-marker';
|
||||
|
||||
@@ -1004,12 +997,6 @@ class AssetApi {
|
||||
if (isFavorite != null) {
|
||||
queryParams.addAll(_queryParams('', 'isFavorite', isFavorite));
|
||||
}
|
||||
if (isArchived != null) {
|
||||
queryParams.addAll(_queryParams('', 'isArchived', isArchived));
|
||||
}
|
||||
if (skip != null) {
|
||||
queryParams.addAll(_queryParams('', 'skip', skip));
|
||||
}
|
||||
|
||||
const contentTypes = <String>[];
|
||||
|
||||
@@ -1025,17 +1012,11 @@ class AssetApi {
|
||||
);
|
||||
}
|
||||
|
||||
/// Get all assets that have GPS information embedded
|
||||
///
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [bool] isFavorite:
|
||||
///
|
||||
/// * [bool] isArchived:
|
||||
///
|
||||
/// * [num] skip:
|
||||
Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isFavorite, bool? isArchived, num? skip, }) async {
|
||||
final response = await getMapMarkersWithHttpInfo( isFavorite: isFavorite, isArchived: isArchived, skip: skip, );
|
||||
Future<List<MapMarkerResponseDto>?> getMapMarkers({ bool? isFavorite, }) async {
|
||||
final response = await getMapMarkersWithHttpInfo( isFavorite: isFavorite, );
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
|
||||
@@ -13,44 +13,38 @@ part of openapi.api;
|
||||
class MapMarkerResponseDto {
|
||||
/// Returns a new [MapMarkerResponseDto] instance.
|
||||
MapMarkerResponseDto({
|
||||
required this.type,
|
||||
required this.id,
|
||||
required this.lat,
|
||||
required this.lon,
|
||||
required this.id,
|
||||
});
|
||||
|
||||
AssetTypeEnum type;
|
||||
String id;
|
||||
|
||||
double lat;
|
||||
|
||||
double lon;
|
||||
|
||||
String id;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is MapMarkerResponseDto &&
|
||||
other.type == type &&
|
||||
other.id == id &&
|
||||
other.lat == lat &&
|
||||
other.lon == lon &&
|
||||
other.id == id;
|
||||
other.lon == lon;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(type.hashCode) +
|
||||
(id.hashCode) +
|
||||
(lat.hashCode) +
|
||||
(lon.hashCode) +
|
||||
(id.hashCode);
|
||||
(lon.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'MapMarkerResponseDto[type=$type, lat=$lat, lon=$lon, id=$id]';
|
||||
String toString() => 'MapMarkerResponseDto[id=$id, lat=$lat, lon=$lon]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'type'] = this.type;
|
||||
json[r'id'] = this.id;
|
||||
json[r'lat'] = this.lat;
|
||||
json[r'lon'] = this.lon;
|
||||
json[r'id'] = this.id;
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -73,10 +67,9 @@ class MapMarkerResponseDto {
|
||||
}());
|
||||
|
||||
return MapMarkerResponseDto(
|
||||
type: AssetTypeEnum.fromJson(json[r'type'])!,
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
lat: mapValueOfType<double>(json, r'lat')!,
|
||||
lon: mapValueOfType<double>(json, r'lon')!,
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
@@ -124,10 +117,9 @@ class MapMarkerResponseDto {
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'type',
|
||||
'id',
|
||||
'lat',
|
||||
'lon',
|
||||
'id',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
4
mobile/openapi/test/asset_api_test.dart
generated
4
mobile/openapi/test/asset_api_test.dart
generated
@@ -117,9 +117,7 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// Get all assets that have GPS information embedded
|
||||
//
|
||||
//Future<List<MapMarkerResponseDto>> getMapMarkers({ bool isFavorite, bool isArchived, num skip }) async
|
||||
//Future<List<MapMarkerResponseDto>> getMapMarkers({ bool isFavorite }) async
|
||||
test('test getMapMarkers', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
@@ -16,8 +16,8 @@ void main() {
|
||||
// final instance = MapMarkerResponseDto();
|
||||
|
||||
group('test MapMarkerResponseDto', () {
|
||||
// AssetTypeEnum type
|
||||
test('to test the property `type`', () async {
|
||||
// String id
|
||||
test('to test the property `id`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
@@ -31,11 +31,6 @@ void main() {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// String id
|
||||
test('to test the property `id`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user