1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-24 12:42:44 +01:00
immich/mobile/lib/shared/models/server_info/server_config.model.dart
Jason Rasmussen 317adc5c28
feat(web,server): external domain setting (#6146)
* feat: external domain setting

* chore: open api

* mobile: handle serverconfig-externalDomain

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2024-01-03 21:54:48 -05:00

41 lines
973 B
Dart

import 'package:openapi/api.dart';
class ServerConfig {
final int trashDays;
final String externalDomain;
const ServerConfig({
required this.trashDays,
required this.externalDomain,
});
ServerConfig copyWith({
int? trashDays,
String? externalDomain,
}) {
return ServerConfig(
trashDays: trashDays ?? this.trashDays,
externalDomain: externalDomain ?? this.externalDomain,
);
}
@override
String toString() =>
'ServerConfig(trashDays: $trashDays, externalDomain: $externalDomain)';
ServerConfig.fromDto(ServerConfigDto dto)
: trashDays = dto.trashDays,
externalDomain = dto.externalDomain;
@override
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is ServerConfig &&
other.trashDays == trashDays &&
other.externalDomain == externalDomain;
}
@override
int get hashCode => trashDays.hashCode ^ externalDomain.hashCode;
}