mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +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:
parent
e028cf9002
commit
a7b9adc692
34 changed files with 501 additions and 364 deletions
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',
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue