server_config.model.dart 673 B

123456789101112131415161718192021222324252627282930313233343536
  1. import 'package:openapi/api.dart';
  2. class ServerConfig {
  3. final int trashDays;
  4. const ServerConfig({
  5. required this.trashDays,
  6. });
  7. ServerConfig copyWith({
  8. int? trashDays,
  9. }) {
  10. return ServerConfig(
  11. trashDays: trashDays ?? this.trashDays,
  12. );
  13. }
  14. @override
  15. String toString() {
  16. return 'ServerConfig(trashDays: $trashDays)';
  17. }
  18. ServerConfig.fromDto(ServerConfigDto dto) : trashDays = dto.trashDays;
  19. @override
  20. bool operator ==(Object other) {
  21. if (identical(this, other)) return true;
  22. return other is ServerConfig && other.trashDays == trashDays;
  23. }
  24. @override
  25. int get hashCode {
  26. return trashDays.hashCode;
  27. }
  28. }