import 'package:equatable/equatable.dart';

abstract class Failure extends Equatable {
  final String message;

  const Failure(this.message);

  @override
  List<Object?> get props => [message];
}

class ServerFailure extends Failure {
  const ServerFailure([super.message = '服务器错误']);
}

class NetworkFailure extends Failure {
  const NetworkFailure([super.message = '网络连接失败，请检查网络']);
}

class CacheFailure extends Failure {
  const CacheFailure([super.message = '本地数据读取失败']);
}

class UnauthorizedFailure extends Failure {
  const UnauthorizedFailure([super.message = '登录已过期，请重新登录']);
}

class ValidationFailure extends Failure {
  const ValidationFailure([super.message = '输入数据无效']);
}
