import '../utils/http/response_model.dart';
import '../utils/http/dio_request.dart';
import '../models/bo/dashboard_bo.dart';

class DashboardRepository {
  /// 获取经营概览看板数据
  /// GET /app/dashboard/overview
  Future<ResponseModel<DashboardOverviewBO>> getOverview() {
    return DioRequest.instance.get<DashboardOverviewBO>(
      '/app/dashboard/overview',
      fromJsonT: (data) =>
          DashboardOverviewBO.fromJson(data as Map<String, dynamic>),
    );
  }

  /// 获取能耗分析数据
  /// GET /app/dashboard/energy-analysis
  Future<ResponseModel<EnergyAnalysisBO>> getEnergyAnalysis() {
    return DioRequest.instance.get<EnergyAnalysisBO>(
      '/app/dashboard/energy-analysis',
      fromJsonT: (data) =>
          EnergyAnalysisBO.fromJson(data as Map<String, dynamic>),
    );
  }
}
