2023-10-22 22:15:34 +02:00
|
|
|
import 'package:openapi/api.dart';
|
|
|
|
|
|
|
|
class ServerConfig {
|
|
|
|
final int trashDays;
|
2024-01-04 04:54:48 +02:00
|
|
|
final String externalDomain;
|
2023-10-22 22:15:34 +02:00
|
|
|
|
|
|
|
const ServerConfig({
|
|
|
|
required this.trashDays,
|
2024-01-04 04:54:48 +02:00
|
|
|
required this.externalDomain,
|
2023-10-22 22:15:34 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
ServerConfig copyWith({
|
|
|
|
int? trashDays,
|
2024-01-04 04:54:48 +02:00
|
|
|
String? externalDomain,
|
2023-10-22 22:15:34 +02:00
|
|
|
}) {
|
|
|
|
return ServerConfig(
|
|
|
|
trashDays: trashDays ?? this.trashDays,
|
2024-01-04 04:54:48 +02:00
|
|
|
externalDomain: externalDomain ?? this.externalDomain,
|
2023-10-22 22:15:34 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2024-01-04 04:54:48 +02:00
|
|
|
String toString() =>
|
|
|
|
'ServerConfig(trashDays: $trashDays, externalDomain: $externalDomain)';
|
2023-10-22 22:15:34 +02:00
|
|
|
|
2024-01-04 04:54:48 +02:00
|
|
|
ServerConfig.fromDto(ServerConfigDto dto)
|
|
|
|
: trashDays = dto.trashDays,
|
|
|
|
externalDomain = dto.externalDomain;
|
2023-10-22 22:15:34 +02:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
2024-01-04 04:54:48 +02:00
|
|
|
return other is ServerConfig &&
|
|
|
|
other.trashDays == trashDays &&
|
|
|
|
other.externalDomain == externalDomain;
|
2023-10-22 22:15:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
2024-01-04 04:54:48 +02:00
|
|
|
int get hashCode => trashDays.hashCode ^ externalDomain.hashCode;
|
2023-10-22 22:15:34 +02:00
|
|
|
}
|