import 'package:injectable/injectable.dart';

import '../../base/app_base_request.dart';
import '../../utils/http_handler.dart';
import '../api/atmob_api.dart';
import '../api/response/zodiac_love_intimacy_love_info_response.dart';
import '../api/response/zodiac_love_intimacy_response.dart';

/// 星座恋爱分析Repository层
@LazySingleton()
class ZodiacLoveIntimacyRepository {
  final String tag = "ZodiacLoveIntimacyRepository";

  final AtmobApi atmobApi;

  ZodiacLoveIntimacyRepository(this.atmobApi);

  /// 获取星座恋爱分析-基本信息
  Future<ZodiacLoveIntimacyLoveInfoResponse> getZodiacLoveIntimacyLoveInfo() async {
    return await atmobApi
        .getZodiacLoveIntimacyLoveInfo(AppBaseRequest())
        .then(HttpHandler.handle(true));
  }

  /// 星座恋爱分析-获取今日指数分析
  Future<ZodiacLoveIntimacyResponse> getZodiacLoveIntimacyToday() async {
    return await atmobApi
        .getZodiacLoveIntimacyToday(AppBaseRequest())
        .then(HttpHandler.handle(true));
  }

  /// 星座恋爱分析-获取未来一周分析
  Future<ZodiacLoveIntimacyResponse> getZodiacLoveIntimacyFutureWeek() async {
    return await atmobApi
        .getZodiacLoveIntimacyFutureWeek(AppBaseRequest())
        .then(HttpHandler.handle(true));
  }
}
