import '../models/bo/alert_list_bo.dart';
import '../repositories/alert_list_repository.dart';

class AlertListService {
  final AlertListRepository _repository;

  AlertListService({required AlertListRepository repository})
      : _repository = repository;

  Future<AlertListBO> getList({
    required int pageSize,
    required int pageNum,
    String? alertStatus,
  }) async {
    final result = await _repository.getList(
      pageSize: pageSize,
      pageNum: pageNum,
      alertStatus: alertStatus,
    );
    if (result.success && result.data != null) {
      return result.data!;
    }
    throw Exception(result.msg);
  }
}