import 'package:news_getx/data/model/news.dart';
import 'package:news_getx/data/provider/news.dart';

import '../model/categories.dart';
import '../model/channels.dart';
import '../model/tag.dart';

class NewsRepository {
  Future<NewsPageListResponse> newsPageList({
    NewsPageListRequest? params,
    bool refresh = false,
    bool cacheDisk = false,
  }) {
    return NewsAPI.newsPageList(
      params: params,
      refresh: refresh,
      cacheDisk: cacheDisk,
    );
  }

  Future<NewsItem> newsRecommend({
    NewsRecommendRequest? params,
    bool refresh = false,
    bool cacheDisk = false,
  }) {
    return NewsAPI.newsRecommend(
      params: params,
      refresh: refresh,
      cacheDisk: cacheDisk,
    );
  }

  Future<List<CategoryResponse>> categories({
    bool cacheDisk = false,
  }) {
    return NewsAPI.categories(cacheDisk: cacheDisk);
  }

  Future<List<ChannelResponse>> channels({
    bool cacheDisk = false,
  }) {
    return NewsAPI.channels(cacheDisk: cacheDisk);
  }

  Future<List<TagResponse>> tags({
    TagRequest? params,
    bool cacheDisk = false,
  }) {
    return NewsAPI.tags(params: params, cacheDisk: cacheDisk);
  }
}
